473,396 Members | 1,774 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,396 software developers and data experts.

Word and VB.NET

Hello friends, somebody could help me to insert in a document of Word
text that I go entering in 4 TextBox, in the word document I have
placed markers in the places that I want that it is the text, in vb6
you toward by means of markers, but with VB.NET and office 2003 are
lost. Thank you and greetings.

--
Ceci est une signature automatique de MesNews.
Site : http://www.mesnews.net

Nov 21 '05 #1
3 1669
"Joey" <no*****@hotmail.com> schrieb:
somebody could help me to insert in a document of Word
text that I go entering in 4 TextBox, in the word document I have
placed markers in the places that I want that it is the text, in vb6
you toward by means of markers, but with VB.NET and office 2003 are
lost.


\\\
Option Strict Off
..
..
..
Dim WordApp As Object = CreateObject("Word.Application")
Dim WordDoc As Object = WordApp.Documents.Open("C:\Hallo.doc")
WordDoc.FormFields("Text1").Result = "Bla"
WordDoc.Save()
WordDoc.Close()
WordApp.Quit()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
Herfried K. Wagner [MVP] a exprimé avec précision :
"Joey" <no*****@hotmail.com> schrieb:
somebody could help me to insert in a document of Word text that I go
entering in 4 TextBox, in the word document I have placed markers in the
places that I want that it is the text, in vb6 you toward by means of
markers, but with VB.NET and office 2003 are lost.
\\\
Option Strict Off
.
.
.
Dim WordApp As Object = CreateObject("Word.Application")
Dim WordDoc As Object = WordApp.Documents.Open("C:\Hallo.doc")
WordDoc.FormFields("Text1").Result = "Bla"
WordDoc.Save()
WordDoc.Close()
WordApp.Quit()
///


hello, thank you for the answer, but I have problems with this it lines
of code:
WordDoc.FormFields("Text1").Result = "Bla"


which the textbox is?
which the marker is?
as control the document to print?

--
Ceci est une signature automatique de MesNews.
Site : http://www.mesnews.net

Nov 21 '05 #3
"Joey" <no*****@hotmail.com> schrieb:
WordDoc.FormFields("Text1").Result = "Bla"


which the textbox is?
which the marker is?
as control the document to print?


It's a text form field. You can add such fields to a dodument using the
"Forms" toolbar. 'Text1' is the name of the marker.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
3
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
2
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to...
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...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
by: beanie | last post by:
i am a c programming beginner and i am trying to Create a concordance of Word Count for a text File in c programming but my code isn't working.please can u help me out.here is my code: #include...
2
by: beanie | last post by:
i am a beginer in c programming and i am trying to Create a Concordance of Word Count for a Text File but my code is not working.pls can anyone helpme out.here is my code: #include <stdio.h>...
0
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and ...
5
by: alivip | last post by:
How can I get every Token (word) and PreviousToken(Previous word) From multube files and frequency of each two word my code is trying to get all single word and double word (every Token (word) and...
1
by: dittytwo | last post by:
Hi there The below code works if you don't try to do anything to the word document which is great (Not :D) I am having problems with the context command both text (i.e initial document with no...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...
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...
0
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,...

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.