Mit folgendem Code öffne ich aus Excel heraus acht bis neun Worddokumente. Das klappt!
Nun möchte ich diese Dokumente aber "Arrangieren" (Funktion "Alle Fenster", die es ja auch in Word gibt)
Ich habe es, wie im Code unten, mit Arrange probiert. Das klappt nicht! zumindest nicht aus dem Excelcode heraus. Zeichne ich in Word das Makro auf, geht es natürlich.
Wie muss ich den Code anpassen?
Sub AllesSehen()
Set WdApp = CreateObject("Word.Application")
Set wdDok = WdApp.Documents.Open(Filename:=Speichpfad, ReadOnly:=False)
WdApp.Visible = True
WdApp.Activate
AppActivate "Microsoft Word"
Application.WindowState = xlMaximized
With WdApp.Selection
.HomeKey Unit:=6 'an den Anfang des Dokuments gehen
.MoveDown Unit:=5, Count:=6
End With
End If
Next
With Wddoc
.ActiveWindow
.Arrange
End With
Set wdDok = Nothing
Set WdApp = Nothing
End Sub
Besten Gruß
Thorsten