I want to create an MDI file by printing to Microsoft Office Document Image Writer. That part is easy; the VB6 code below does it quite nicely.
But there is one problem with it. The moment it creates the file ... it launches the MDI viewer. I don't want it to launch the viewer. I will be processing the file myself, through code.
How do I stop it from launching the viewer!?
For Each oPrinter In Printers
If InStr(1, oPrinter.DeviceName, "Microsoft Office Document Image Writer", vbTextCompare) > 0 Then
If Not oPrinter Is Nothing Then
Set oWord = New Word.Application
oWord.ActivePrinter = oPrinter.DeviceName
Set oWordDoc = oWord.Documents.Open(strNew)
oWordDoc.SaveAs Environ("TEMP") & "\eek.mdi"
oWordDoc.PrintOut Range:=wdPrintAllPages, Collate:=True, PrintToFile:=True, OutputFileName:=Environ("TEMP") & "\eek.mdi"
Set oWordDoc = Nothing
Set oWord = Nothing