Home All Groups Group Topic Archive Search About

word automation bookmarks

Author
14 May 2006 12:11 PM
andreas
With a vb.net application (vb.net 2003) , I want to make a new word doc
where I put several bookmarks and also text  in paragraphs following the
bookmarks
How to do?
Thanks for any response

Author
15 May 2006 8:53 AM
Fred Hedges
First, import a reference to the Word Object Library, then create an
instance of Word:

        m_WordApplication = New Word.Application
        m_MainDocument =
m_WordApplication.Documents.Add(Template:=CType(m_TemplatePath, Object))
        m_WordApplication.Visible = False

Then use the documented Word Object Model to navigate and manipulate the
document, including modifying the bookmarks collection and/or
inserting/editing text.  A word of caution however, make sure you release
references you make to word objects, otherwise you'll find Word hanging
around in memory even after your program has terminated.





Show quoteHide quote
"andreas" <andr***@pandora.be> wrote in message
news:78F9g.424466$vD1.11523184@phobos.telenet-ops.be...
> With a vb.net application (vb.net 2003) , I want to make a new word doc
> where I put several bookmarks and also text  in paragraphs following the
> bookmarks
> How to do?
> Thanks for any response
>
>
Author
15 May 2006 3:22 PM
andreas
Thanks but I know all these things.
Wat I like to know are the real commands for inserting f.i. two bookmarks
following bij text.
Can jou write this?


Show quoteHide quote
"Fred Hedges" <dontlike@spammuch.com> wrote in message
news:e49fj1$d4j$1$8300dec7@news.demon.co.uk...
> First, import a reference to the Word Object Library, then create an
> instance of Word:
>
>         m_WordApplication = New Word.Application
>         m_MainDocument =
> m_WordApplication.Documents.Add(Template:=CType(m_TemplatePath, Object))
>         m_WordApplication.Visible = False
>
> Then use the documented Word Object Model to navigate and manipulate the
> document, including modifying the bookmarks collection and/or
> inserting/editing text.  A word of caution however, make sure you release
> references you make to word objects, otherwise you'll find Word hanging
> around in memory even after your program has terminated.
>
>
>
>
>
> "andreas" <andr***@pandora.be> wrote in message
> news:78F9g.424466$vD1.11523184@phobos.telenet-ops.be...
> > With a vb.net application (vb.net 2003) , I want to make a new word doc
> > where I put several bookmarks and also text  in paragraphs following the
> > bookmarks
> > How to do?
> > Thanks for any response
> >
> >
>
>
Author
15 May 2006 4:18 PM
Fred Hedges
If you know all this, then you will know that the Word object model is well
documented in Word itself (Word Visual Basic Reference).  To add a bookmark:

m_Document.Bookmarks.Add (Name:="temp", Range:=m_SelectionRange)

Use the selection range of the text you have inserted and collapse it to the
end before inserting the bookmark.




Show quoteHide quote
"andreas" <andr***@pandora.be> escribió en el mensaje
news:R01ag.427163$VO.11304088@phobos.telenet-ops.be...
> Thanks but I know all these things.
> Wat I like to know are the real commands for inserting f.i. two bookmarks
> following bij text.
> Can jou write this?
>
>
> "Fred Hedges" <dontlike@spammuch.com> wrote in message
> news:e49fj1$d4j$1$8300dec7@news.demon.co.uk...
>> First, import a reference to the Word Object Library, then create an
>> instance of Word:
>>
>>         m_WordApplication = New Word.Application
>>         m_MainDocument =
>> m_WordApplication.Documents.Add(Template:=CType(m_TemplatePath, Object))
>>         m_WordApplication.Visible = False
>>
>> Then use the documented Word Object Model to navigate and manipulate the
>> document, including modifying the bookmarks collection and/or
>> inserting/editing text.  A word of caution however, make sure you release
>> references you make to word objects, otherwise you'll find Word hanging
>> around in memory even after your program has terminated.
>>
>>
>>
>>
>>
>> "andreas" <andr***@pandora.be> wrote in message
>> news:78F9g.424466$vD1.11523184@phobos.telenet-ops.be...
>> > With a vb.net application (vb.net 2003) , I want to make a new word doc
>> > where I put several bookmarks and also text  in paragraphs following
>> > the
>> > bookmarks
>> > How to do?
>> > Thanks for any response
>> >
>> >
>>
>>
>
>