Microsoft Word and saving

Hi,
I would like to have this script to save the document created to a filename I choose and save it to Users:Chris:Documents. The script does all but that. Can anyone please help??

Thanks,
Chris D.

tell application "Microsoft Word"
	set dp to choose folder
	activate
	set newDoc to text returned of (display dialog "Enter Document Name.." default answer "")
	if newDoc does not end with ".doc" then set newDoc to newDoc & ".doc"
	set newDoc to make new document
	set name of font object of text object of newDoc to "Verdana"
	save as newDoc
end tell

Model: Intel MacBook
AppleScript: 2.11
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi Chris

First, you set the variable newDoc twice; the second one overruling the first one. And second, why don’t you use Word’s dialogs?

Would this wor for you?

tell application "Microsoft Word"
	activate
	set theDoc to make new document
	set name of font object of text object of theDoc to "Verdana"
	save theDoc
end tell

Ahh yes, this does work, but I would like to make this script an application so that all I do is click the application in the dock and it makes the new document and automatically saves it to the “Documents” folder in the “Users” folder.

Heres what I’ve been working on…

set desk_path to path to desktop as Unicode text
tell application "Microsoft Word"
	set newDoc to text returned of (display dialog "Enter Document Name.." default answer "")
	if newDoc does not end with ".doc" then set newDoc to newDoc & ".doc"
	set newDoc to make new document
	set newDoc to uniDoc as Unicode text
	save as newDoc file name (desk_path & uniDoc) --The default without the path saves in the Office 2004 folder.
end tell

I’m going to incorporate your script into another script…
Thanks for the help,
Chris D.

Model: Intel MacBook
AppleScript: 2.11
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi Chris,

try this

set docFolder to path to documents folder as Unicode text
set newDocName to text returned of (display dialog "Enter Document Name.." default answer "")
if newDocName does not end with ".doc" then set newDocName to newDocName & ".doc"
tell application "Microsoft Word"
	set newDoc to make new document
	set name of font object of text object of newDoc to "Verdana"
	save newDoc in (docFolder & newDocName)
end tell

Try this:

set desk_path to path to desktop as Unicode text
tell application "Microsoft Word"
	set uniDoc to text returned of (display dialog "Enter Document Name.." default answer "")
	if uniDoc does not end with ".doc" then set uniDoc to uniDoc & ".doc"
	make new document
	save as active document file name (desk_path & uniDoc) --The default without the path saves in the Office 2004 folder.
end tell

Thanks to all that helped! It finally worked as planned!

Thanks so much,
Chris D.