Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default VBA to print Word Document

Hello, I have a Macro that prints Excel Tabs in a certain order. Now I need
to know how I can print a Word Document inside this macro. Here is my macro.

On Error Resume Next
Application.ActivePrinter = "HP C LaserJet 4550N PCL6 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "hp c Laserjet 4550N PCL6 on Ne02:"
Err.Clear
End If
Sheets("Letter").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

I would need to have the Word Doc Print after the first "Agreement" prints.
How can I do this? Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default VBA to print Word Document

Brad

You can use the ShellExecute API as described here

http://www.dicks-blog.com/archives/2.../shellexecute/

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Brad wrote:
Hello, I have a Macro that prints Excel Tabs in a certain order. Now
I need to know how I can print a Word Document inside this macro.
Here is my macro.

On Error Resume Next
Application.ActivePrinter = "HP C LaserJet 4550N PCL6 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "hp c Laserjet 4550N PCL6 on Ne02:"
Err.Clear
End If
Sheets("Letter").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

I would need to have the Word Doc Print after the first "Agreement"
prints. How can I do this? Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert excel document to word document (not a picture) frendabrenda1 Excel Discussion (Misc queries) 2 October 6th 06 03:55 PM
how do i rotate a document or print small document on envelope crystal New Users to Excel 2 March 23rd 06 03:52 PM
transfer data to fill a word document to print (automatically) snaggy^^ Excel Discussion (Misc queries) 0 January 19th 06 05:01 PM
2 questions: Using solver in Macro AND converting to Word document to print A3 yendor28 Excel Discussion (Misc queries) 3 November 17th 05 07:55 PM
Print merge an Excel document with three worksheets to WORD Docume pfe Excel Programming 1 December 2nd 04 08:22 PM


All times are GMT +1. The time now is 06:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"