Print Word Document in Dot Matrix Printer with Printer Default Font

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
hi i m using this this coding to copy and print the word document

<span style="color:#0000ff; font-size:x-small <span style="color:#0000ff; font-size:x-small
<pre lang="x-vbnet System.IO.File.Copy(Application.StartupPath &
"PrintT.doc", Application.StartupPath & "PrintT1.doc", True)

Dim line1 As String

Dim line2 As String

line1 = "Line1 Replace"

line2 = "Line2 Replace"

Dim objWordApp As New Word.Application
objWordApp.Visible = True

Open an existing document.

Dim objDoc As Word.Document = objWordApp.Documents.Open(Application.StartupPath & "PrintT1.doc")

objDoc = objWordApp.ActiveDocument

Find and replace some text

Replace VB with Visual Basic

objDoc.Content.Find.Execute(FindText:="Line1",ReplaceWith:=line1, Replace:=Word.WdReplace.wdReplaceAll)

objDoc.Content.Find.Execute(FindText:="Line2", ReplaceWith:=line2, Replace:=Word.WdReplace.wdReplaceAll)

objDoc.Content.Find.Execute(FindText:="Line3", ReplaceWith:="Line3 Replace", Replace:=Word.WdReplace.wdReplaceAll)





Save and close the document



objDoc.Save()

objDoc.PrintOut(True, True)

objDoc.Close()

objDoc = Nothing

objWordApp.Quit()

objWordApp = Nothing

[/code]
now i need to print the Word Document with Printer Default Font(Draft 17.5 CPI) in Dot Matricx Printer


View the full article
 
Back
Top