Save File In Multiple Formats in Microsoft Word?

I’d like to write a script that will save my Microsoft Word documents in multiple formats; when I run the script, it should save the front window in native Word format, and then save copies of the same document as text only, html, and, if possible, PDF (or maybe print-to-pdf on OS X). The idea is that, on our fileserver, some version of the document will always be readable on any machine (including from a text-only terminal), and that it will happen more-or-less automatically.

I haven’t really used Word in several years. I noticed that the latest Word seems to be recordable, and started to tinker with it, but managed to lock up the script editor the first time I ran the script containing the VBA code that Word generated. Word complained about a VBA syntax error, and the script editor locked up and I had to force-quit.

Can anyone offer me any tips on how to approach this, or at least point me to where I should be looking for documentation and sample code? I haven’t found good VBA documentation anywhere, yet, and looking through Word’s scripting dictionary was less enlightening than I had hoped.

Thanks,

Sarah

Hi

You could record a macro in word that saves the files and then use this macro in your applescript

the code would be


tell application "Microsoft Word"
	activate
	open the_item
	--roman macro uitvoeren
	do Visual Basic "NameOfTheMacro"
	close document 1 of window 1 without saving
end tell