Putting bookmark text in document properties field 
Author Message
 Putting bookmark text in document properties field

Can anyone tell me how to put bookmark text into a builtin
document properties field so that it comes up in the
Document Properties window. The text is put into the
bookmark from a user form.

Vernon



Tue, 26 Apr 2005 17:27:21 GMT  
 Putting bookmark text in document properties field
Hi Vernon,

You can use something like the following:

With ActiveDocument
    .BuiltInDocumentProperties("Title") = _
        .Bookmarks("Test").Range.Text
End With

You can also use the Word constants to identify the document property. See
the VBA help file topic "BuiltInDocumentProperties Property" for more
informaiton about the constants.

HTH


Quote:
> Can anyone tell me how to put bookmark text into a builtin
> document properties field so that it comes up in the
> Document Properties window. The text is put into the
> bookmark from a user form.

> Vernon



Tue, 26 Apr 2005 21:11:54 GMT  
 Putting bookmark text in document properties field
Thanks Dave. Where should I put this code? For the
CommandButton click event, I have

UpdateBookmark "Text1", TextBox1

Then I have a subroutine:

Sub UpdateBookmark(BookmarkToUpdate As String, TextToUse
As String)
          Dim BMRange As Range
          Set BMRange = ActiveDocument.Bookmarks
(BookmarkToUpdate).Range
          BMRange.Text = TextToUse
          ActiveDocument.Bookmarks.Add BookmarkToUpdate,
BMRange

End Sub

Regards

Vernon

Quote:
>-----Original Message-----
>Hi Vernon,

>You can use something like the following:

>With ActiveDocument
>    .BuiltInDocumentProperties("Title") = _
>        .Bookmarks("Test").Range.Text
>End With

>You can also use the Word constants to identify the

document property. See
Quote:
>the VBA help file topic "BuiltInDocumentProperties
Property" for more
>informaiton about the constants.

>HTH



>> Can anyone tell me how to put bookmark text into a
builtin
>> document properties field so that it comes up in the
>> Document Properties window. The text is put into the
>> bookmark from a user form.

>> Vernon

>.



Sat, 30 Apr 2005 17:29:30 GMT  
 Putting bookmark text in document properties field
Hi Vernon,

You'd place it after
ActiveDocument.Bookmarks.Add BookmarkToUpdate, BMRange
so that your document property has the current content.

HTH


Quote:
> Thanks Dave. Where should I put this code? For the
> CommandButton click event, I have

> UpdateBookmark "Text1", TextBox1

> Then I have a subroutine:

> Sub UpdateBookmark(BookmarkToUpdate As String, TextToUse
> As String)
>           Dim BMRange As Range
>           Set BMRange = ActiveDocument.Bookmarks
> (BookmarkToUpdate).Range
>           BMRange.Text = TextToUse
>           ActiveDocument.Bookmarks.Add BookmarkToUpdate,
> BMRange

> End Sub

> Regards

> Vernon

> >-----Original Message-----
> >Hi Vernon,

> >You can use something like the following:

> >With ActiveDocument
> >    .BuiltInDocumentProperties("Title") = _
> >        .Bookmarks("Test").Range.Text
> >End With

> >You can also use the Word constants to identify the
> document property. See
> >the VBA help file topic "BuiltInDocumentProperties
> Property" for more
> >informaiton about the constants.

> >HTH



> >> Can anyone tell me how to put bookmark text into a
> builtin
> >> document properties field so that it comes up in the
> >> Document Properties window. The text is put into the
> >> bookmark from a user form.

> >> Vernon

> >.



Sat, 30 Apr 2005 21:14:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. locking Custom Document Properties and Bookmarks

2. populating document properties from text in document

3. Form Fields In Document Without Bookmarks?

4. Using one fill-in field as a bookmark reference for rest of document

5. Inserting Bookmarks and Text into a Word Document

6. Problem when unprotecting a document with form field text fields

7. Entering text in form field of locked document pushes text on same line

8. ADO Put a space between 2 fields concatenated together in .ListField property

9. putting text in a word document

10. I need to get words from text document and put then into database

11. Pasting clipboard text to hyperlink/bookmark fields in macro

12. Text field and Bookmarks

 

 
Powered by phpBB® Forum Software