The following code lacks two abilities:
1. I need to be able to introduce a VBA or macro code line that sends
an <Enter> key stroke to force the popup print window to print.
2. I need to send the print job to lpt3
Ideas on how to do these two items with the macro code below?
Sub CreatePDFs()
'
' CreatePDFs Macro
' Macro recorded 4/11/2002 by Systems Dept.
'
Dim fileName As String, pathName As String
Documents.Open fileName:="Print_Labels.doc",
ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
fileName = Dir("c:\data\*.txt")
pathName = "c:\data\"
Do While fileName <> ""
ActiveDocument.MailMerge.OpenDataSource Name:=pathName &
fileName, _
ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="",
SQLStatement:="", SQLStatement1 _
:=""
Application.OnTime When:=Now + TimeValue("00:00:8"), _
Name:="sendKey_Enter"
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.Execute
End With
fileName = Dir
Loop
ActiveDocument.Close
End Sub
Sub sendKey_Enter()
'
' sendKey_Enter Macro
' Macro recorded 4/11/2002 by Systems Dept.
'
MsgBox "Hi"
End Sub
Thanks