To All,

    There is more than one status bar in Word 2007 and the name is different
than what is in Notepad so this is what I did to get it to speak the status
bar in my Page_Num app to get the line and column number in Notepad and now
at least the Page and word count in Word 2007.

you have more than one status bar in Woord 2007 so do a loop and speak it.
This is one of 2 methods to get the item number for the object in 2007 for
it will not return an object until you know it's location.

App Segment:
 dim objMainWindow, objStatusBarWindow, objResults
 set objMainWindow = activeWindow.overlap
'First Notepad:
 set objResults = objMainWindow.children.filterByName( "msctls_statusbar32")
 if not objResults is nothing then
  if objResults.count > 0 then
   ' Window Found!
   set objStatusBarWindow = objResults(1) ' where 1 is the location for the
Status Bar object.
   SpeakStatusBar objStatusBarWindow
   Exit Sub
  end if
 end if
' Word 2007:
  set objResults = objMainWindow.children.filterByName( "status bar")
  if not objResults is nothing then
    ' Go through the collection of status bar objects.
   For Each objStatusBarWindow in objResults
    SpeakStatusBar objStatusBarWindow
    Exit Sub
   Next
  End If
End Sub

Sub SpeakStatusBar( oStatusbar)
   ' now speak contents of the object clips.
' First convert any text for easier reading.
   Dim txt: txt = oStatusbar.clips.clipstext
   txt = Replace( txt, "Ln", " Line ")
   txt = Replace( txt, "Col", " column ")
   txt = Replace( txt, ",", " ")
   Speak txt
End Sub

Reply via email to