What I am trying to do:
; pdfpath := path . "\Further folder\Document.pdf"
; oWord.ActiveDocument.SaveAs2(pdfpath, 17)
I'm not sure why "17" is there in the second command, I got this code from an earlier Autohotkey Forum post.
It's probably not relevant, but the full code here is:
Code: Select all
WordMultiReplace("Stuff", "Other stuff")
WordMultiReplace(params*) {
oWord := ComObjActive("Word.Application")
oWord.Selection.Find.ClearFormatting
oWord.Selection.Find.Replacement.ClearFormatting
For k,v in Params
{
c++
if (c = 1)
{
st := v
continue
}
rt := v, c := 0
oWord.Selection.Find.Execute(st, 0, 0, 0, 0, 0, 1, 1, 0, rt, 2)
}
oWord.ActiveDocument.SaveAs
pdfpath := path . "\Further folder\Document.pdf"
oWord.ActiveDocument.SaveAs2(pdfpath, 17)
WinClose
}
return