VBA Shade property not scriptable?

G

gwieland

All you applescript experts out there. I'm 'converting' word macros to applescript and can't find an equivalent to the following VBA syntax in the Word applescript dictionary.

ActiveDocument.FormFields.Shaded = True

Anybody know if it's scriptable?
 
P

Paul Berkowitz

There's a read/write 'field shading' property of 'view' class, which
"returns or sets on-screen shading for form fields." That looks promising.

You'll often find that in VBA there are Collection Objects (like FormFields
collection of Document) that cannot be handled in the same way in
AppleScript, which does not have Collection Objects but rather lists of
elements.

Since 'Shaded' is not a Property of the individual FormField Object (which
transfers to the 'form field' class in AppleScript), but *only* of the
FormFields Collection Object, there can be no exact equivalent. There's no
'shaded' property of form field in either AppleScript or VBA.

But I'd try it it this way, getting the active window of the active
document, then its view, and setting the field shading property of the view
to always:


tell application "Microsoft Word"
set field shading of view of active window of active document to field
shading always
end tell


I just tried it with a mail-merge in progress and it worked.


P.S. We're very short here of AppleScripters and I'm now too busy with my
"day job" to come here much at the moment. It would be great if you could
stick around and help others.


--
Paul Berkowitz
MVP MacOffice
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top