F
FUBARinSFO
Hi:
Out of old-timey recollection, I tried to use Sendkeys in Word 2003 to
enter some text. But it didn't work, and I had to resort to
Selection.TypeText. Code below.
If someone would be kind enough to clarify why Sendkeys doesn't work
in this context I would appreciate it very much.
-- Roy Zider
Sub PrintLayoutView()
'
' PrintLayoutView Macro
' Macro recorded 12/3/2007 by Roy Zider
'
' Developed to set invoice view to Print Layout View
'
Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdLine
' .. this doesn't work:
' SendKeys "x", True
' SendKeys "{BS}", True
' .. this does:
Selection.TypeText Text:="x"
Selection.TypeBackspace
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdPrintView
Else
ActiveWindow.View.Type = wdPrintView
End If
ActiveWindow.Close
End Sub
Out of old-timey recollection, I tried to use Sendkeys in Word 2003 to
enter some text. But it didn't work, and I had to resort to
Selection.TypeText. Code below.
If someone would be kind enough to clarify why Sendkeys doesn't work
in this context I would appreciate it very much.
-- Roy Zider
Sub PrintLayoutView()
'
' PrintLayoutView Macro
' Macro recorded 12/3/2007 by Roy Zider
'
' Developed to set invoice view to Print Layout View
'
Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdLine
' .. this doesn't work:
' SendKeys "x", True
' SendKeys "{BS}", True
' .. this does:
Selection.TypeText Text:="x"
Selection.TypeBackspace
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdPrintView
Else
ActiveWindow.View.Type = wdPrintView
End If
ActiveWindow.Close
End Sub