General discussion

Locked

Recorded VB Macro gives error when run

By steve_james ·
Using Word XP as the email editor in Outlook XP, we
recorded 2 macros to be able to print emails to 1 of 2
printers. These macros work fine in Word, and also when
composing a new email, but will not work in a received
email. The error response is "Run-time error 438. Object
doesn't support this property or method", with the
debugger referring to Application.Printout

Any ideas?

The macros are:
Sub Brother()
'
' Brother Macro
' Macro recorded 10/28/2003 by Mark James
'
ActivePrinter = "\\Compaq\Brother HL-10h"
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True,
Background:=True, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub
Sub Epson()
'
' Epson Macro
' Macro recorded 10/28/2003 by Mark James
'
ActivePrinter = "\\compaq\EPSON Stylus COLOR 760"
Application.PrintOut FileName:="",
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True,
Background:=True, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub


Any thoughts appreciated!
MJ

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by D_Gilmour_1978 In reply to Recorded VB Macro gives e ...

That macro won't work in outlook it works for new messages as they are actually in word. Looking at the object model for outlook should shed some light on the matter. If you are still having issues re-post and I'll try to write the code for you

Collapse -

by steve_james In reply to Recorded VB Macro gives e ...

Thanks for your comments David, but sorry, don't know enough about Outlook/VBA Objects to make use of your reply. The Ms Outlook Objects in MsVB Project 1 shows ThisOutlookSession, but the right pane is blank.

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums