473,659 Members | 2,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3343
First, import a reference to the Word Object Library, then create an
instance of Word:

m_WordApplicati on = New Word.Applicatio n
m_MainDocument =
m_WordApplicati on.Documents.Ad d(Template:=CTy pe(m_TemplatePa th, Object))
m_WordApplicati on.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*****@pandor a.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******@spamm uch.com> wrote in message
news:e4******** ***********@new s.demon.co.uk.. .
First, import a reference to the Word Object Library, then create an
instance of Word:

m_WordApplicati on = New Word.Applicatio n
m_MainDocument =
m_WordApplicati on.Documents.Ad d(Template:=CTy pe(m_TemplatePa th, Object))
m_WordApplicati on.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*****@pandor a.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.Book marks.Add (Name:="temp", Range:=m_Select ionRange)

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


"andreas" <an*****@pandor a.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******@spamm uch.com> wrote in message
news:e4******** ***********@new s.demon.co.uk.. .
First, import a reference to the Word Object Library, then create an
instance of Word:

m_WordApplicati on = New Word.Applicatio n
m_MainDocument =
m_WordApplicati on.Documents.Ad d(Template:=CTy pe(m_TemplatePa th, Object))
m_WordApplicati on.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*****@pandor a.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
3834
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 sure someone where will know how to do the following. We have a Word Template which is our standard contract type. I have some data stored my access database record. I want to merge the two together.
1
2144
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 to do this with my db. Here is my code: Private Sub MergeButton_Click() On Error GoTo MergeButton_Err
0
6297
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 reformating, after the merge. This is a full description of my needs. I have a C# class library that creates two Crystal Reports, and then exports them to the harddrive as Word documents. One's orientation is landscape, the other is portrait. I then...
7
4988
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 template (in my application) based on the user input. When the document gets opened there should be fields users can change but others should be prevented from beeing changed (I know that an "open" file format like XML can always be modified to allow...
7
6237
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 user and populated (with info from an Access database) at run-time, then saved as Word documents. The program I have coded works fine -- it does what I need it to do. But it has two problems: (1) it runs very slowly, and (2) it does not seem to...
1
2580
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 there some boiler plate code for C++ or VC++ that I could use to edit and add my data to the bookmark locations in the MS Word doc file? After I have updated the MS Word file I need to print it to a network printer. Is there a easy way of...
1
2904
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 when i add the code for inserting header;an error apear instead of header in the document the error is this:Error! Bookmark not defined. and this is the piece of code i added for inserting header:
0
3196
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 selection from the checklistbox is being pulled in. Also I need the information thats pulled in to be on a separate page in the same document. Hope that makes sense. Anyway here is my code. Here is my code: (VB.Net) Dim wdApp As...
10
3274
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 document in pdf and that is all I want done with it. How can I tell it to close the file without prompting me for anything? For Each row As DataRow In myDt.Rows Dim objWord As Application Dim objDoc As Document objWord =...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.