> Hello!
>
[quoted text clipped - 13 lines]
>
> Thanks for any suggestion
You can add a custom document property, by adding to the
CustomDocumentProperties collection of the document, or you can add a
document variable, by adding to the Variables collection of the document.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Warrio - 18 Jul 2007 13:36 GMT
Hi Jonathan!
Thanks for your response,
but how do you add a new variable in document that is created automatically?
I'll need to generate have a code that writes code inside the new
document... I know how to do it manually but I won't be there when the user
will click on the button to create the document...
also there is a place into the properties of the document (File menu,
Properties) but I couldn't find the direct VBA command to set it.
Thanks again
>> Hello!
>>
[quoted text clipped - 17 lines]
> CustomDocumentProperties collection of the document, or you can add a
> document variable, by adding to the Variables collection of the document.
Jonathan West - 18 Jul 2007 13:40 GMT
> Hi Jonathan!
>
[quoted text clipped - 9 lines]
>
> Thanks again
Look up the Variables collection in the VBA Help - there is a code example.
Similarly, if you decide to use a custom document property, look up the
DocumentProperties collection in VBA help. Both collections have an Add
method that allows you to create a new variable or property.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Warrio - 18 Jul 2007 18:05 GMT
Thanks agiain!! it works perfectly now!
>> Hi Jonathan!
>>
[quoted text clipped - 14 lines]
> up the DocumentProperties collection in VBA help. Both collections have an
> Add method that allows you to create a new variable or property.
Warrio - 18 Jul 2007 18:47 GMT
if it could help someone, here is the syntax...
myDoc.CustomDocumentProperties.Add Name:="CommentName", Value:="coment
balabla", Type:=msoPropertyTypeString
>> Hi Jonathan!
>>
[quoted text clipped - 14 lines]
> up the DocumentProperties collection in VBA help. Both collections have an
> Add method that allows you to create a new variable or property.
Warrio - 18 Jul 2007 15:56 GMT
Thanks a lot!
CustomDocumentProperties works fine!
>> Hello!
>>
[quoted text clipped - 17 lines]
> CustomDocumentProperties collection of the document, or you can add a
> document variable, by adding to the Variables collection of the document.