|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
word automation bookmarksWith 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 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 > > 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 > > > > > > 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 >> > >> > >> >> > >
updatecommand
Design Question for Factory Pattern and Casting Types Storing collection of one class inside another to read a textfile regarding his format Session variable as string (array) Floating Menu Bar using MDIList in a MDI form code convertor in VB.NET Express Edition Access MDI child properties generically vb.net 2005 bug in the ide (wipes out code) |
|||||||||||||||||||||||