• 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
RE: Working with Word Document Properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Working with Word Document Properties


  • Subject: RE: Working with Word Document Properties
  • From: Scott Babcock <email@hidden>
  • Date: Fri, 1 Jun 2007 11:02:18 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Working with Word Document Properties

In regard to deletion of custom document properties in Word AppleScript, it appears that you've found a bug. You can work around this with the 'do Visual Basic' event:

tell application "Microsoft Word"
    set vbCode to "ActiveDocument.CustomDocumentProperties(\"foo\").Delete"
    do Visual Basic vbCode
end tell

I logged the 'delete' bug against Word AppleScript.

In regard to modifying values of built-in document properties, some of these are read-only. The ones you mention are among them. I think that the set of read-only document properties is documented anywhere. However, you can glean some information from the Properties dialog. If a property is in the Summary section, it's writable. If it's in the Statistics section, it's read-only.

The only programmatic way to tell that a property is read-only is to attempt to modify its value and read it back to see if the change stuck. You won't ever get an error trying to write to a read-only document property. (You get the same behavior from VB.)

-----Original Message-----

Date: Thu, 31 May 2007 23:26:42 -0700
From: David Glass <email@hidden>
Subject: Working with Word Document Properties
To: AppleScript Users <email@hidden>
Message-ID:
        <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

I'm trying to write a script that will strip as much of the metadata
out of a Word document as possible, and have run into a couple of snags.

1. Even though the Word (2004) dictionary shows 'get/set/delete' for
'custom document property' I am unable to actually delete any.  I
receive an error that the custom document property doesn't understand
the delete message.  Has anybody gotten this to work?

2. I can't seem to effect a change in the Revision number, Total time
edited, and a couple of other standard document properties.  I don't
get an error when I try to modify their values, but the values don't
change.  Any thoughts on if this is the proper behavior?

Thanks for any guidance.

--
David Glass - Gray Matter Computing

 _______________________________________________
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

  • Prev by Date: Re: Searching a Mail message
  • Next by Date: iTunes events
  • Previous by thread: Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
  • Next by thread: iTunes events
  • Index(es):
    • Date
    • Thread