Hallo Leute,
folgendes Problem: ich möchte bilder in Word importieren mittels eines Autoit Scriptes.
Dies funktioniert sowiet. Mein Problem ist aber das er mit dem ersten beginnt und dieses am Ende wenn alle Bilder im Word dokument eingefügt wurden, am Ende steht.
Gibt es eine Möglichkeit das Letzte Bild als erstes zu importieren ?
Hier mein Quellcode:
#include <Word.au3>
#include <File.au3>
#include <Array.au3>
$sPath = "C:\Temp\unzip"
$search = FileFindFirstFile($sPath & "*.jpeg")
; Check if the search was successful
If $search = -1 Then
MsgBox(0, "Error", "No images found")
Exit
EndIf
$oWordApp = _WordCreate ()
$oDoc = _WordDocGetCollection ($oWordApp, 0)
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
$oShape = _WordDocAddPicture ($oDoc, $sPath & $file, 0, 1)
If Not @error Then $oShape.Range.InsertAfter (@CRLF)
WEnd
; Close the search handle
FileClose($search)