Accessing SET Fields in Macros

O

Ole

Hi Everybody,

is it possible to access the SET fields that are in the document to use the
data these fields have acquird from a database?

If that is possible, how would I do that?

Thank you for your time

Ole
 
M

macropod

Hi Ole,

If you want to access the data relating to a SET field, simply retrieve the corresponding bookmark's contents.
 
O

Ole

Hi,

thank you for the quicjk response. I am glad to hear that it works.

Now, I am working my way through processing that data and getting it back
into the document, but I am not an experienced programmer in VB. Would it be
very impolite to ask for a code sample how to get the Data out of the
bookmarks?

I access the bookmark like

Application.ActiveDocument.Bookmarks.Item("Test").Select

but how can I go on? I think the online help was much better in former
versions...

Ole

macropod said:
Hi Ole,

If you want to access the data relating to a SET field, simply retrieve
the corresponding bookmark's contents.

--
Cheers
macropod
[MVP - Microsoft Word]


Ole said:
Hi Everybody,

is it possible to access the SET fields that are in the document to use
the data these fields have acquird from a database?

If that is possible, how would I do that?

Thank you for your time

Ole
 
G

Graham Mayor

Dim orng As Range
Set orng = ActiveDocument.Bookmarks("Test").Range
MsgBox orng 'do what you want with the range

You may find http://www.gmayor.com/SelectFile.htm useful

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Hi,

thank you for the quicjk response. I am glad to hear that it works.

Now, I am working my way through processing that data and getting it
back into the document, but I am not an experienced programmer in VB.
Would it be very impolite to ask for a code sample how to get the
Data out of the bookmarks?

I access the bookmark like

Application.ActiveDocument.Bookmarks.Item("Test").Select

but how can I go on? I think the online help was much better in former
versions...

Ole

macropod said:
Hi Ole,

If you want to access the data relating to a SET field, simply
retrieve the corresponding bookmark's contents.

--
Cheers
macropod
[MVP - Microsoft Word]


Ole said:
Hi Everybody,

is it possible to access the SET fields that are in the document to
use the data these fields have acquird from a database?

If that is possible, how would I do that?

Thank you for your time

Ole
 
O

Ole

Oh, I see; I made a mistake in the SET-statement. That is why I got a wrong
value.

You helped me a lot.

Thank you both very much!!


Graham Mayor said:
Dim orng As Range
Set orng = ActiveDocument.Bookmarks("Test").Range
MsgBox orng 'do what you want with the range

You may find http://www.gmayor.com/SelectFile.htm useful

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Hi,

thank you for the quicjk response. I am glad to hear that it works.

Now, I am working my way through processing that data and getting it
back into the document, but I am not an experienced programmer in VB.
Would it be very impolite to ask for a code sample how to get the
Data out of the bookmarks?

I access the bookmark like

Application.ActiveDocument.Bookmarks.Item("Test").Select

but how can I go on? I think the online help was much better in former
versions...

Ole

macropod said:
Hi Ole,

If you want to access the data relating to a SET field, simply
retrieve the corresponding bookmark's contents.

--
Cheers
macropod
[MVP - Microsoft Word]


Hi Everybody,

is it possible to access the SET fields that are in the document to
use the data these fields have acquird from a database?

If that is possible, how would I do that?

Thank you for your time

Ole
 

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