R
Richard Bond
Hi,
I'm trying to automate word 2000/XP from VB. I have late
bound to the Word application and am trying to set the
document to landscape (other VBA code has worked).
However the code does not seem to work, I then tried to
use sendKeys , but that didn't work either. Can anyone
help out please?
Here is the code:
Const wdOrientPortrait = 0
With oWordApp
.ActiveDocument.PageSetup.Orientation = wdOrientPortrait
End With
'or (version specific)
oWordApp.Activate
WaitPlease(0.5) ' Waits 0.5 sec.
SendKeys "%F", 1 ' Alt + F = File
SendKeys "%u", 1 ' Alt + u = Page setup
SendKeys "%s", 1 ' Alt + s = Landscape
thanks for any help,
Richard
I'm trying to automate word 2000/XP from VB. I have late
bound to the Word application and am trying to set the
document to landscape (other VBA code has worked).
However the code does not seem to work, I then tried to
use sendKeys , but that didn't work either. Can anyone
help out please?
Here is the code:
Const wdOrientPortrait = 0
With oWordApp
.ActiveDocument.PageSetup.Orientation = wdOrientPortrait
End With
'or (version specific)
oWordApp.Activate
WaitPlease(0.5) ' Waits 0.5 sec.
SendKeys "%F", 1 ' Alt + F = File
SendKeys "%u", 1 ' Alt + u = Page setup
SendKeys "%s", 1 ' Alt + s = Landscape
thanks for any help,
Richard