T
Torsten Hansen
Hello,
I want to start Word from another programm (Excel, Access, FrontPage...)
with a little makro and set the orientation in the PageSetup-Menue on
"Landscape", but it doesn't work.
Word starts but the orientation has not been set on "Landscape".
Does anybody know what's wrong in my makro?
Sub Test()
Dim WordObj As Object
Dim WordDoc As Object
On Error Resume Next
Set WordObj = GetObject(, "Word.Application.10")
If Err.Number = 429 Then
Set WordObj = CreateObject("Word.Application.10")
Err.Number = 0
End If
WordObj.Visible = True
Set WordDoc = WordObj.Documents.Add
WordObj.ActiveDocument.PageSetup.Orientation = wdOrientLandscape
Set WordDoc = Nothing
Set WordObj = Nothing
End Sub
Thanks!
Torsten
I want to start Word from another programm (Excel, Access, FrontPage...)
with a little makro and set the orientation in the PageSetup-Menue on
"Landscape", but it doesn't work.
Word starts but the orientation has not been set on "Landscape".
Does anybody know what's wrong in my makro?
Sub Test()
Dim WordObj As Object
Dim WordDoc As Object
On Error Resume Next
Set WordObj = GetObject(, "Word.Application.10")
If Err.Number = 429 Then
Set WordObj = CreateObject("Word.Application.10")
Err.Number = 0
End If
WordObj.Visible = True
Set WordDoc = WordObj.Documents.Add
WordObj.ActiveDocument.PageSetup.Orientation = wdOrientLandscape
Set WordDoc = Nothing
Set WordObj = Nothing
End Sub
Thanks!
Torsten