Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can anyone help on a macro prob
I have a macro which is shown below. 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 ActiveDocument.Close Documents.Open FileName:="Doc2.doc", ConfirmConversions:=False, ReadOnly:= _ False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _ "", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _ Format:=wdOpenFormatAuto With Selection.Tables(1) With .Shading .Texture = wdTextureNone .ForegroundPatternColor = wdColorAutomatic .BackgroundPatternColor = wdColorAutomatic End With With .Borders(wdBorderLeft) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderRight) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth050pt .DefaultBorderColor = wdColorAutomatic End With 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 ActiveDocument.Saved = True ActiveDocument.Close End Sub The trouble is its closing the first document after its set up to print but dont make no changes by removing the colours when it prints the 2nd one. It then just completely freezes up and nothing happens. It says on macro to same printer but will actually be printed to 2 seperate printers. Can anyone help as to why it keeps freezing. I also dont need it to save changes when the colours removed. Can anyone help? Thanks -- tweacle |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can anyone help on a macro prob
Hi Tweacle,
The trouble is its closing the first document after its set up to print but dont make no changes by removing the colours when it prints the 2nd one. It then just completely freezes up and nothing happens. It says on macro to same printer but will actually be printed to 2 seperate printers. I'm guessing the problem could come from the fact that you're leaving "Background printing" active. This means that the macro will continue before the first print job has completely finished, which can always lead to problems. Put this line at the beginning of your code Application.Options.PrintBackground =False and this one at the end if you want to leave the option on for the user Application.Options.PrintBackground =True Even better programming practice would be to get the user's setting, then make sure you restore it at the end. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I Save Stationery-BUT SUDDEN PROB-CANT SEND TO ME/ONLY OTHERS | Microsoft Word Help | |||
Word 2000 printing prob | Microsoft Word Help | |||
Layout Prob. | Page Layout | |||
Hidden Hdr/Ftr - using Print Layout - Not white sp prob | Microsoft Word Help | |||
formatting text prob | Microsoft Word Help |