473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

word automation bookmarks

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
3 3326
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JP SIngh | last post by:
HI All I just wonder if anyone has created a word document using ASP. I am able to create a work document with ASP without any problem but what I want to do is slightly more than I know. I am...
1
by: moelleni | last post by:
Hi, I made an Access 2002 Database and wanted to automate it to sent the current record to Word 2002. So readed the article "How to send the current record to Word 2000 with automation" I tried...
0
by: mharris | last post by:
I need help with merging two Word documents into one through C# code. The problem isn't so much getting the documents put into one as it is maintaining the appropriate formatting, or rather...
7
by: Daniel Walzenbach | last post by:
Hello, I want to create a Word XML file based on the input users make in a VB.NET application. I imagine creating a template in Word and saving it as a XML file. I then want to fill the...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
1
by: electrixnow | last post by:
I wrote a program in VC++ that generates a text file report. I would like to get this report data into a word document that my company uses. I could use bookmarks for reference in the document. Is...
1
by: bluestar | last post by:
hello i am trying to develope an application for word automation.i need to insert header and footer to the document. i found an exampke in msdn and used it in my application.it works well;but...
0
by: deboe | last post by:
I am trying to pull in some data from a database (Access) and merge the data to a Word document (basically mail merge). I got the data to fill in the bookmarks in the document but only the first...
10
by: cj2 | last post by:
I open a word template in VB and add values to the bookmarks then save the document as as pdf. When I then go to close the document it pops up a save as dialog box. It's already saved the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.