i'm simply trying to close a document (without quitting word), but this does not work.
I've tried :
but none of this is working..
The error I get (on the close line) is:
Here is a simplified script. Anyone have any ideas? All examples online seem to use this syntax, not sure if anything changed in the mac office 2011 version? Or is it just me? Does this code work on your system?
Thanks in advance.
I've tried :
Code:
close documents saving no
close active document
close document 1
but none of this is working..
The error I get (on the close line) is:
Code:
Microsoft Word got an error: The object you are trying to access does not exist
Thanks in advance.
Code:
set input to {POSIX path of "/Users/Wesley/Desktop/test.doc"}
--ENABLE GUI SCRIPTING
tell application "System Events"
if UI elements enabled is false then set UI elements enabled to true
end tell
--RUN THE GUISCRIPT
set pdfSavePath to POSIX path of (choose folder with prompt "Set destination folder")
repeat with x in input
display dialog x
tell application "Microsoft Word"
activate
open x
set theActiveDoc to the active document
close theActiveDoc saving no
return
end tell
end repeat
Last edited: