Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Printer not there

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Curt - 21 Mar 2008 07:15 GMT
useing the following code I get message 5852 requested object not available?
Stumped as I print all the time I am running this macro from excel all code
is in same sub  .destination = wdSendToPrinter------error 5852 is marked in
code also
Thanks
Dim word As New word.Application
Dim wordDoc As word.Document
word.Visible = True
ChangeFileOpenDirectory "\Parade"
   Documents.Open Filename:="\ThankMailE.doc", ConfirmConversions:=False, _
       ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
       PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
       WritePasswordTemplate:="", Format:=wdOpenFormatAuto
   With ActiveDocument.MailMerge
        .destination = wdSendToPrinter------error 5852
     ' Application = ActivePrinter
      'ActiveSheet.PrintOut
       .MailAsAttachment = False
       .MailAddressFieldName = ""
       .MailSubject = ""
Helmut Weber - 21 Mar 2008 09:37 GMT
Hi Curt,

you got to fully qualify the word objects
when running the code from Excel,
like
word.Documents.Open
and
with word.ActiveDocument.MailMerge

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.