Hi,
this should be easy and it should be working.
I have to check a number of Powerpoint Files and assign a password (if they don't have one yet) and export the file to a pdf (if it doesn't exist yet.)
$FilePath and $FileName are defined elsewhere; you just need to point them at something like
$FilePath = "c:presentation.ppt"
$FileName = "presentation.ppt"
The script opens the file, waits for it to either open or request a password (covers for German and English installations - I know it's not pretty.)
If a password is requested, it is supplied here.
I am then trying to export the file to pdf, and this keeps failing.
I have no idea what else I should be expected to do here. any pointer or suggestions?
This is for autoit v3.3.8.1, Microsoft Office 2010 and Windows 7 (Enterprise)
ShellExecute($FilePath)
Do
until WinExists("Kennwort")
; we have opened the file. At this stage, there should be a full window, or a password prompt. If the latter, we'll supple the password and wait
if WinExists("Kennwort") then
WinActivate ("Kennwort")
ControlSetText ("Kennwort", "", 6, "Password")
ControlClick ("Kennwort", "", 1)
EndIf
if WinExists("Kennwort") then
WinActivate ("Kennwort")
ControlSetText ("Kennwort", "", 6, "Password")
ControlClick ("Kennwort", "", 1)
EndIf
Do
until WinExists($FileName)
sleep (10000)
WinActivate ($FileName)
$word = Objget("", "PowerPoint.Application")
$word.activepresentation.ExportAsFixedFormat ($FilePath & ".pdf", 2)
$word.activepresentation.close
$word.Quit