#1   Report Post  
Posted to microsoft.public.word.docmanagement
galatea2153 galatea2153 is offline
external usenet poster
 
Posts: 18
Default Problems with Macros

Hi - I'm using XP SP2 and Office 2007. I'm trying to write a macro to send
documents to a particular tray (say tray 1 or 2) on a particular printer
(printer 2). (Currently I have to go to Print/Choose Printer
2/Properties/Choose Tray 1 etc etc). I thought it would be a relatively easy
thing to record a macro, using mouseclicks, as it's not a complicated
procedure, just an annoying one!

Anyway - macro seems to record okay, but doesn't actually work! What it
does, instead, is change my default printer from my printer (printer 1) to
printer 2; and only takes paper from Tray 1, rather than either tray
(depending on which macro I use).

I thought this might be because I'm connected to Printer 2 via a network ...
however, I've tried to create the same macro on Printer 2's computer, and
virtually the same thing happens.

I'm at a bit of a loss, and would appreciate any help. I hope my
explanation is clear enough! (By the way - I know nothing about VBE, I only
know how to create macros by using mouse-clicks or keystrokes).

Thanks in advance,

Megan
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Problems with Macros

The following should work:

Sub LaserTray2()
Dim sCurrentPrinter As String
sCurrentPrinter = ActivePrinter
ActivePrinter = "Put the name of the required printer here"
With Options
.DefaultTray = "Set the tray option here"
End With
Application.PrintOut FileName:=""
With Options
.DefaultTray = "Use printer settings"
End With
ActivePrinter = sCurrentPrinter
End Sub

See also http://www.gmayor.com/fax_from_word.htm and
http://pubs.logicalexpressions.com/P...cle.asp?ID=116

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


galatea2153 wrote:
Hi - I'm using XP SP2 and Office 2007. I'm trying to write a macro
to send documents to a particular tray (say tray 1 or 2) on a
particular printer (printer 2). (Currently I have to go to
Print/Choose Printer 2/Properties/Choose Tray 1 etc etc). I thought
it would be a relatively easy thing to record a macro, using
mouseclicks, as it's not a complicated procedure, just an annoying
one!

Anyway - macro seems to record okay, but doesn't actually work! What
it does, instead, is change my default printer from my printer
(printer 1) to printer 2; and only takes paper from Tray 1, rather
than either tray (depending on which macro I use).

I thought this might be because I'm connected to Printer 2 via a
network ... however, I've tried to create the same macro on Printer
2's computer, and virtually the same thing happens.

I'm at a bit of a loss, and would appreciate any help. I hope my
explanation is clear enough! (By the way - I know nothing about
VBE, I only know how to create macros by using mouse-clicks or
keystrokes).

Thanks in advance,

Megan



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two problems with macros [email protected] Microsoft Word Help 4 February 6th 06 05:26 PM
With macros enabled I still receive "macros disabled" warning. Blakthorne Microsoft Word Help 6 November 1st 05 07:20 PM
Problems with macros after upgrade to 2003 Carol Giannini Microsoft Word Help 1 April 15th 05 06:22 PM
Macros in 2003 multiple but connected problems? V-ger Microsoft Word Help 8 January 18th 05 09:42 PM
Problems with Macros? I'm not sure what the problem is. College Student Microsoft Word Help 1 December 5th 04 03:45 AM


All times are GMT +1. The time now is 08:05 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"