Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Use
..PrintOut Background:=False That will prevent the next command in the macro from being executed until the document has finished printing. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "kbgrunt" wrote in message ... Shauna, thanks for the help. If I add just the .PrintOut the document prints. If I add both the PrintOut and Application.Quit - Word opens, see the document, the document closes then Word hangs with a blank grey window and the report never prints. My guess is that Word is attempting to quit while report is still printing. Is there a way to pause/wait/sleep to allow report time to spool/print, before Word attempts to quit? Windows XP Pro, Word 2000. Will use this with Word 2000-2003. Thanks "Shauna Kelly" wrote: Hi kbgrunt Assuming that you don't need to save the changes you've made, the following should work: Public Sub SetupReport() Documents.Open "d:\d\test\test1.doc" With ActiveDocument .PageSetup.Orientation = wdOrientLandscape With .Range .Font.Name = "Courier New" .Font.Size = 7 End With .PrintOut End With Application.Quit SaveChanges:=wdDoNotSaveChanges End Sub Hope this helps. Shauna Kelly. Microsoft MVP. http://www.shaunakelly.com/word "kbgrunt" wrote in message ... With help from Jay Freedman I now have a macro that I am using inside a batch file to open an ASCII text file from a unix system, and compress the print. Is it possible to take it a step further and actually print the file then close Word? This is the basic macro so far, I have added some margin settings... Public Sub SetupReport() Documents.Open "C:\docs\wide.txt" ActiveDocument.PageSetup.Orientation = wdOrientLandscape With ActiveDocument.Range .Font.Name = "Courier New" .Font.Size = 7 End With End Sub Thanks. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help! I'm getting error messages too much-can't open Resume Wizard | Microsoft Word Help | |||
Envelope Address | New Users | |||
Templates | Page Layout | |||
word print dialog box delay | Microsoft Word Help | |||
word xp crashes after macros are recorded | Microsoft Word Help |