VBScript Wizardry

Andrew Kluthe andrew at ctech.me
Tue Sep 11 16:21:48 EDT 2012


Hello,

Trying to use VBScript to turn an open word document into a pdf file.

>From looking at

http://stackoverflow.com/questions/8807153/vbscript-to-convert-word-doc-to-pdf

and

http://www.robvanderwoude.com/vbstech_automation_word.php#SaveAsPDF

it seems what with word 2010 or word 2007 with an add-on I can use vb
script to convert a word document into a pdf.

I get an execution error in "the result" when I try this code.

if there is a file tReportFile then
      launch document tReportFile
      answer thePDFFileName
      put "Set objDoc = .ActiveDocument" & cr after sScript
      put "objDoc.SaveAs " & quote & thePDFFileName & quote & ",
wdFormatPDF" & cr after sScript
      answer sScript
      do sScript as "vbscript"
      answer the result
   end if

The document launches in word and but I get an execution error in "the
result" when the vbscript is ran.

Are there any VBScript/LiveCode wizards out there that could help?

-- 
Regards,

Andrew Kluthe
andrew at ctech.me




More information about the use-livecode mailing list