Search the web
Sign In
New User? Sign Up
MicrosoftOffice · Microsoft Office
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Click here for the latest updates on Groups Message search

Messages

  Messages Help
Advanced
Problems using VBA script to print   Topic List   < Prev Topic  |  Next Topic >
Reply < Prev Message  | 
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




Sat Apr 13, 2002 10:42 pm

wharmon97
Offline Offline
Send Email Send Email

< Prev Message  | 
Expand Messages Author Sort by Date

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...
wharmon97
Offline Send Email
Apr 13, 2002
10:42 pm

How about a brief primer on what this job is intended to do just so I can get a grip on what you wish it *really* would do? It looks to me like you're wanting...
Greg Chapman
gregatmouset...
Offline Send Email
Apr 14, 2002
3:03 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help