Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
tweacle[_5_] tweacle[_5_] is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I Save Stationery-BUT SUDDEN PROB-CANT SEND TO ME/ONLY OTHERS Twinkle2z Microsoft Word Help 1 November 19th 06 02:29 AM
Word 2000 printing prob Rian Microsoft Word Help 1 October 26th 06 08:01 PM
Layout Prob. Tourq31 Page Layout 2 June 6th 06 03:57 AM
Hidden Hdr/Ftr - using Print Layout - Not white sp prob Bud I. Microsoft Word Help 5 November 20th 05 03:51 PM
formatting text prob Joe Rogers Microsoft Word Help 1 March 12th 05 02:16 PM


All times are GMT +1. The time now is 11:33 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"