Getting rid of macros in Word Documents

Hey All,
I’m a Help Desk tech at a company that publishes magazines and from time to time we use outside copy editors. For whatever ridiculous reason, one of them did not have virus protection and used macros. Now, we have about 60 Office 2004 for Mac users that are spreading a virus to PC users via Macros. I need a way to process large quantities of files so that macros is removed from them. Here are my options:

Open the document in Pages and export back to Word (.doc) - that rids the file of Macros

Open the document in Word and save as Rich Text (.rtf) and then save back to Word (.doc)

Is there a way to script this? Or better yet, make an automator action?

I appreciate any input on this as my boss would REALLY love to get rid of this and I’d love to work on something else.

Hi,

try this droplet


on open theseFiles
	repeat with oneFile in theseFiles
		if name extension of (info for oneFile) is "doc" then
			tell application "Microsoft Word"
				open (oneFile as text)
				tell document 1
					set doc to full name
					set rtf to (text 1 thru -3 of doc & "rtf")
					save as file name rtf file format format rtf
					save as file name doc file format format document
					close
				end tell
			end tell
			do shell script "rm " & quoted form of POSIX path of rtf
		end if
	end repeat
end open

Hey Stefan, thanks again for your reply. I get this as an error when I drop one file named “6.doc”

I changed “open” to “activate” and it popped up with:

It looks like you’ve found my solution, but there’s some syntax I don’t quite understand in there.

hm, I’ve tested it successfully on Leopard / Word 2004,
but it works also with an alias


.
tell application "Microsoft Word"
		open oneFile
		tell document 1
.

and I did another little mistake


.
set rtf to (text 1 thru -4 of doc & "rtf")
.

Thanks a lot, Stefan. That is perfect. I’ll be sure to post the final product when I’m done. This a cheap way to clear out macros. You’re a lifesaver!