Word and VB.NET

  • Thread starter Thread starter Joey
  • Start date Start date
J

Joey

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.
 
Joey said:
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()
///
 
Herfried K. Wagner [MVP] a exprimé avec précision :
\\\
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?
 
Joey said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top