Creating custom document property?

S

Scott Ribe

Is it possible to create a custom document property without resorting to do
Visual Basic? I can create a document variable, but haven't gotten creation
of a document property to work.
 
J

John McGhie [MVP - Word and Word Macintosh]

Yes, it is possible to create a Custom Document Property without VBA, in
fact, it's the preferred way to do it. It is NOT possible to create a
Document Variable without using VBA :)

The procedure in the Help works, provided you follow it exactly:

Create custom file properties for the active document
1. On the File menu, click Properties, and then click the Custom tab.

2. In the Name box, type a name for the custom property, or click a name in
the list.

3. In the Type box, click the type of property you want.

4. In the Value box, type a value for the property.

The value you enter must match the selection in the Type box. For example,
if you click Number in the Type box, you must type a number in the Value
box. Values that don't match the property type are stored as text

5. Click Add


What's the bet you're forgetting to click "Add" in Step 5 -- I always do
that and have to come back and define it again. Every time :)

Cheers


Is it possible to create a custom document property without resorting to do
Visual Basic? I can create a document variable, but haven't gotten creation
of a document property to work.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 
S

Scott Ribe

Yes, it is possible to create a Custom Document Property without VBA, in
fact, it's the preferred way to do it. It is NOT possible to create a
Document Variable without using VBA :)

I see my question was incomplete. I'm scripting. By "without resorting to do
Visual Basic", I meant in AppleScript, using regular AppleScript "make
new..." terminology.
 
P

Peter Jamieson

If I was sitting in front of my Mac I'd have a go at this one. If there's a
"right answer" in AppleScript I'm sure someone will provide it. If there's
no other solution you may be able to workaround as follows (i.e. it works on
Windows Word, but I can't check for Mac Word)

To create a text custom Document Property called myproperty with value
myvalue, use Applescript
a. to create a text file containing

{\rtf1\ansi{\*\userprops {\propname mytextproperty}\proptype30{\staticval
mytextvalue}}}

b. to insert it into your document.

(You might have to do a bit of tidying after, e.g. remove a paragraph mark
or some such).

Peter Jamieson

Scott Ribe said:
Word
Macintosh] at (e-mail address removed) wrote on 2/8/07 9:49 PM:
Yes, it is possible to create a Custom Document Property without VBA, in
fact, it's the preferred way to do it. It is NOT possible to create a
Document Variable without using VBA :)

I see my question was incomplete. I'm scripting. By "without resorting to
do
Visual Basic", I meant in AppleScript, using regular AppleScript "make
new..." terminology.
 
P

Peter Jamieson

BTW I was unable to work out how to create a custom document property
directly from AppleScript. Not that that means it definitely can't be
done...

Peter Jamieson
Peter Jamieson said:
If I was sitting in front of my Mac I'd have a go at this one. If there's
a "right answer" in AppleScript I'm sure someone will provide it. If
there's no other solution you may be able to workaround as follows (i.e.
it works on Windows Word, but I can't check for Mac Word)

To create a text custom Document Property called myproperty with value
myvalue, use Applescript
a. to create a text file containing

{\rtf1\ansi{\*\userprops {\propname mytextproperty}\proptype30{\staticval
mytextvalue}}}

b. to insert it into your document.

(You might have to do a bit of tidying after, e.g. remove a paragraph mark
or some such).

Peter Jamieson

Scott Ribe said:
Word
Macintosh] at (e-mail address removed) wrote on 2/8/07 9:49 PM:
Yes, it is possible to create a Custom Document Property without VBA, in
fact, it's the preferred way to do it. It is NOT possible to create a
Document Variable without using VBA :)

I see my question was incomplete. I'm scripting. By "without resorting to
do
Visual Basic", I meant in AppleScript, using regular AppleScript "make
new..." terminology.
 

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