By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,455 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

word automation bookmarks

P: n/a
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
May 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <an*****@pandora.be> wrote in message
news:78***********************@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

May 15 '06 #2

P: n/a
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" <do******@spammuch.com> wrote in message
news:e4*******************@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" <an*****@pandora.be> wrote in message
news:78***********************@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


May 15 '06 #3

P: n/a
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.


"andreas" <an*****@pandora.be> escribió en el mensaje
news:R0**********************@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" <do******@spammuch.com> wrote in message
news:e4*******************@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" <an*****@pandora.be> wrote in message
news:78***********************@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
>
>



May 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.