error signature

G

gary at protocol

Running Word 2003 SP1, macro that changes the activeprinter. If I change the
default printer or run another macro that switches the printer, get following
error:
error signature
appname winword.exe app/ver 11.0.6359.0 appstamp 40c8b025
Modname winword.exe Mod/ver 11.0.6359.0 Modstamp 40c8b025
debug 0 Offset 0002cc75
here is the macro:
PrinterVar = ActivePrinter
MyString = Mid(PrinterVar, 1, 10)
If UCase(MyString) = "\\IBM235\L" Then
With ActiveDocument.PageSetup
Options.DefaultTray = "Tray 2"
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
End With

ActiveDocument.PrintOut
With ActiveDocument.PageSetup
Options.DefaultTray = "Tray 1"
.FirstPageTray = wdPrinterAutomaticSheetFeed
.OtherPagesTray = wdPrinterAutomaticSheetFeed
End With
endif

If I change the default printer then click on this macro, I'll get the error
signature.
Any help would be appreciated
Gary
 
C

Chuck

The code works for me (obviously if I change the printer identification).

Are you sure that the printer identification string is specific enough? For
instance, are there printers that could match "\\IBM235\L" but not allow the
tray default choices you're requesting?

Have you set breakpoints to see where your code fails?

I notice the End If at the end of your code is "endif" which is not valid -
have you compiled your code properly to make sure there's no bugs?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top