• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Word - How to Access Custom Document Properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Word - How to Access Custom Document Properties
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: PATH variable for do shell script
  • Next by Date: Re: PATH variable for do shell script
  • Previous by thread: Seeking an applescript to extract info from an email and create a calendar even with alerts repeated at certain intervals
  • Next by thread: Re: Word - How to Access Custom Document Properties
  • Index(es):
    • Date
    • Thread