Hi,
I do a merge between my word (.dot) template and value entered on my vb.net form.
Below is my code.
The problem I have is when a document is printed, I see Word appearing in the taskbar. For maybe a quarter second, but still I don't want to. With all the properties I set, isn't supposed to be all processes background and not visible.
Thanks for helping.
Dim objWord As Word.Application
objWord = CreateObject("Word.Application")
With objWord
.ActivePrinter = "TOSHIBA e-STUDIO16/20/25 PCL 6"
.Visible = False
.WindowState = Word.WdWindowState.wdWindowStateMinimize
.Documents.Open("C:\Projets\Taxi_Diamond\Comite_de_discipline\FORMULAIRE_DE_PLAINTE_FR10.dot")
.ActiveDocument.Bookmarks.Item("siPLAINTE").Select() 'word doc bookmark
.Selection.Text = clsClass.NoPlainte
.ActiveDocument.Bookmarks.Item("siMEMBRE").Select() 'word doc bookmark
.Selection.Text = clsClass.NoMembre
.ActiveDocument.Bookmarks.Item("siPOCKET").Select() 'word doc bookmark
.Selection.Text = clsClass.NoPocket
.PrintOut(Copies:=1, Collate:=True, Background:=True, PrintToFile:=False)
'Wait for document to print
Do While .BackgroundPrintingStatus > 0
Application.DoEvents()
Loop
.Documents.Close(Word.WdSaveOptions.wdDoNotSaveChanges)
.Quit()
End With
I do a merge between my word (.dot) template and value entered on my vb.net form.
Below is my code.
The problem I have is when a document is printed, I see Word appearing in the taskbar. For maybe a quarter second, but still I don't want to. With all the properties I set, isn't supposed to be all processes background and not visible.
Thanks for helping.
Dim objWord As Word.Application
objWord = CreateObject("Word.Application")
With objWord
.ActivePrinter = "TOSHIBA e-STUDIO16/20/25 PCL 6"
.Visible = False
.WindowState = Word.WdWindowState.wdWindowStateMinimize
.Documents.Open("C:\Projets\Taxi_Diamond\Comite_de_discipline\FORMULAIRE_DE_PLAINTE_FR10.dot")
.ActiveDocument.Bookmarks.Item("siPLAINTE").Select() 'word doc bookmark
.Selection.Text = clsClass.NoPlainte
.ActiveDocument.Bookmarks.Item("siMEMBRE").Select() 'word doc bookmark
.Selection.Text = clsClass.NoMembre
.ActiveDocument.Bookmarks.Item("siPOCKET").Select() 'word doc bookmark
.Selection.Text = clsClass.NoPocket
.PrintOut(Copies:=1, Collate:=True, Background:=True, PrintToFile:=False)
'Wait for document to print
Do While .BackgroundPrintingStatus > 0
Application.DoEvents()
Loop
.Documents.Close(Word.WdSaveOptions.wdDoNotSaveChanges)
.Quit()
End With