Word - How to Access Custom Document Properties
Word - How to Access Custom Document Properties
- Subject: Word - How to Access Custom Document Properties
- From: Dave <email@hidden>
- Date: Tue, 03 Nov 2015 10:36:54 +0000
Hi All,
I’m trying to write a script that checks if a number of Custom Document Properties have been set and if so, do something with the Value field, but I can’t figure how to access them in AppleScript.
Why does this give an error on the repeat line?
on run
tell application id "com.microsoft.Word"
activate
set myDocument to the document of the front window
set myCustomProperties to the custom document properties of myDocument
repeat with myCustomProperty in custom document properties of myDocument
set myName to the name of myCustomProperty
set myValue to the value of myCustomProperty
end repeat
return "OK"
end tell
end run
error "Microsoft Word got an error: every custom document property of document of window \"Sample1.docx\" doesn’t understand the “count” message." number -1708 from every custom document property of document of window "Sample1.docx"
How would I check if there is a Custom Document Property with the Names “LTWDocID” and “LTWDocType” are present and if so get the values?
Thanks in advance, All the Best
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden