J
Jeffrey Lee
I have finally gotten my doc to print where and how I need it. Essentially, I
needed it to not go to the default printer, save a copy as doc file by unique
name, copy to clipboard and a few other things I needed. What I can't get is
how to tell it
if doc is = or less than 1 page, go to "printer a" else go to "printer b"
I was going to paste all the defective code here but it takes up space and
doesn't work. Here is the part that does work. Thanks for any help.
Jeff
'Sets printer to print this document to the datacenter printer, does not
chnage default printer.
Dim sCurrentPrinter As String
sCurrentPrinter = ActivePrinter
ActivePrinter = "\\Stpprntv02\FSA_Claims Holding on NE08"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, COPIES:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
ActivePrinter = sCurrentPrinter
'unlocks doc (doc is protected) to copy the whole doc to save in Acorde.
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
'copies whole doc to clipboard
Selection.WholeStory
Selection.Copy
'locks doc after paste into Acorde
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True
End If
'Creates numeric text file called "settings" (on network) to store doc by
unique name
Order = System.PrivateProfileString("Q:\Shared\Settings.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("Q:\Shared\Settings.txt", "MacroSettings", _
"Order") = Order
'Saves file with unique name to network location as backup by time and
sequence number.
ActiveDocument.SaveAs FileName:="q:\shared\denial2dc\" & Format(Now,
"hh-mm-ss") & Format(Order, "-00#")
End Sub
needed it to not go to the default printer, save a copy as doc file by unique
name, copy to clipboard and a few other things I needed. What I can't get is
how to tell it
if doc is = or less than 1 page, go to "printer a" else go to "printer b"
I was going to paste all the defective code here but it takes up space and
doesn't work. Here is the part that does work. Thanks for any help.
Jeff
'Sets printer to print this document to the datacenter printer, does not
chnage default printer.
Dim sCurrentPrinter As String
sCurrentPrinter = ActivePrinter
ActivePrinter = "\\Stpprntv02\FSA_Claims Holding on NE08"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, COPIES:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
ActivePrinter = sCurrentPrinter
'unlocks doc (doc is protected) to copy the whole doc to save in Acorde.
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
'copies whole doc to clipboard
Selection.WholeStory
Selection.Copy
'locks doc after paste into Acorde
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True
End If
'Creates numeric text file called "settings" (on network) to store doc by
unique name
Order = System.PrivateProfileString("Q:\Shared\Settings.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("Q:\Shared\Settings.txt", "MacroSettings", _
"Order") = Order
'Saves file with unique name to network location as backup by time and
sequence number.
ActiveDocument.SaveAs FileName:="q:\shared\denial2dc\" & Format(Now,
"hh-mm-ss") & Format(Order, "-00#")
End Sub