E
elpada
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I have a .dot template file that I use daily. I don't have a problem with the rest of the script but i'd like to replace two dialog boxes with text that i've already entered in fields DName and DOB, but for the life of me cannot figure out how to reference or pull the text out of these two text fields in a word 2008 document. Essentially the first two text form fields in the document contain the name and date of birth and i want to turn that into the file name.
i.e. what i've got now
tell application "Microsoft Word"
set DName to text returned of (display dialog "What is the name?" default answer " "
set DOB to text returned of (display dialog "What is DOB?" default answer " "
set NameDob to DName & "." & DOB
log NameDob
save as active document file name NameDob
end tell
and what i'd like...
tell application "Microsoft Word"
set DName to value of field dname
set DOB to value of field DOB
set NameDob to DName & "." & DOB
log NameDob
save as active document file name NameDob
end tell
I've tried lots of variations of the above but can't figure this out. Any thoughts.
i.e. what i've got now
tell application "Microsoft Word"
set DName to text returned of (display dialog "What is the name?" default answer " "
set DOB to text returned of (display dialog "What is DOB?" default answer " "
set NameDob to DName & "." & DOB
log NameDob
save as active document file name NameDob
end tell
and what i'd like...
tell application "Microsoft Word"
set DName to value of field dname
set DOB to value of field DOB
set NameDob to DName & "." & DOB
log NameDob
save as active document file name NameDob
end tell
I've tried lots of variations of the above but can't figure this out. Any thoughts.