How to Set CustomProperties For a Document???

P

Pankaj

Hello Guys,

Please Can u tell me how to set CustomProperties to a New Document??
If Anybody Knows please reply me its urgent
 
C

Cindy M -WordMVP-

Hi Pankaj,
Please Can u tell me how to set CustomProperties to a New Document??
If Anybody Knows please reply me its urgent
Depends on the programming language you're using, which you
unfortunately don't mention. Basic VBA syntax:

Set prop = Doc.CustomDocumentProperties.Add( _
Name:="NameOfProp", _
LinkToContent:=false, _
Type:=msoPropertyTypeString, _
Value:="Value of property", _
LinkSource:=false

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
P

Pankaj

Hi Cindy

I am working in Visual Studio 2005.
I have selected VB project.

I have tried this code already but the problem is that
Error: is for "Doc.CustomDocumentProperties"
it states that Name "Doc.CustomDocumentProperties" is not declared.

And I cant undestand how to face it.
Please can u guide me.

Thanks.
 
J

Jonathan West

Pankaj said:
Hi Cindy

I am working in Visual Studio 2005.
I have selected VB project.

I have tried this code already but the problem is that
Error: is for "Doc.CustomDocumentProperties"
it states that Name "Doc.CustomDocumentProperties" is not declared.

And I cant undestand how to face it.
Please can u guide me.

Try changing Doc to ActiveDocument, or any other object variable you have
declared to be of type Document.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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