Hallo zusammen,
würde gern aus einer Excel in eine neue Wortfile kopieren und Wordfile müsste in Querformat sein. Mein Code nimmt er aber nicht also Wordfile ist nach wie vor vertikal. Was mache ich Falsch ?
Vielen dank im Voraus
Sub WordFile()
Dim objDoc As Object
Dim varname As Variant
varname = Application.GetSaveAsFilename("Aktualisierung", "Document Files (*.doc), *.doc")
If varname = False Then Exit Sub
Set objDoc = CreateObject("word.document")
With Worksheets("Übergabe")
.Range("A1:K127").Copy
End With
objDoc.Windows(1).PageSetup.Orientation = wdOrientLandscape
objDoc.Windows(1).Selection.Paste
objDoc.SaveAs varname
Set objDoc = Nothing
End Sub
|