Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-08-2016, 12:37 PM
meabhpowers meabhpowers is offline Blank VBA box Windows 7 32bit Blank VBA box Office 2010 32bit
Novice
Blank VBA box
 
Join Date: Jan 2016
Posts: 3
meabhpowers is on a distinguished road
Default Blank VBA box

I have created a macro that would print to a specific printer (not default) and current page only. I've created macros in the past without any problems. But when I run this I get a box displayed on the screen titled Microsoft Visual Basic for Application with white X inside a red circle and buttons for OK, Help.

This is the macro:
Sub envelope()
'
' envelope Macro
'
'


ActivePrinter = "\\JOHNSONHALL\Laser 4"
Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub


I've also tried this macro which 'sort of' worked. This selected the printer on the 2nd try but ignored the Current Page:
Sub test()
ActiveDocument.PrintOut wdPrintCurrentPage
ActivePrinter = "\\JOHNSONHALL\Laser 4"
End Sub

There is a delay when manually selecting a printer which I suspect is part of the problem (system related). The default printer is Adobe PDF which needs to remain in place for another function. I only need WORD to change printer for hard copies.

Any thoughts?

Thanks!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blank VBA box If IF/AND Criteria is Blank, Give me "Blank" tbesh Excel 1 09-07-2015 09:43 AM
Blank VBA box Formulato say if cell is blank do this, if not blank do this. mbesspiata Excel 1 01-17-2015 05:02 AM
Blank VBA box Row Looks to be blank but its not bremen22 Excel Programming 2 01-29-2014 09:07 AM
Page numberring 1 - blank - 2 - blank etc Intern PowerPoint 0 09-02-2011 01:16 AM
Blank VBA box How to turn all blank lines into non-blank for legal forms sieler Word 3 04-12-2009 01:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft