Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Add an invisible comment

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Warrio - 18 Jul 2007 11:15 GMT
Hello!

Sorry for the previous post in French...

I'm wondering if it is possible with VBA to add a comment to a new document
created in with code as well.
With MsAccess, there is for each control, a property "Tag" that allows to
add any string

I unfortunately cannot add a line into one of the document's pages (even in
small and in white font) because it would change the general layout of the
document.

and because it is a new document, I cannot give it a new variable and then
set it...

Thanks for any suggestion
Jonathan West - 18 Jul 2007 13:13 GMT
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.