VBA and printers

J

JayM

Hi
I have some macros to enable my users to print documents quickly

The code is as follows:
Sub PRINT_THIN_P()
' PRINT_THIN_P Macro
UNPROTECTDOCUMENT
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterPaperCassette
.OtherPagesTray = wdPrinterPaperCassette
End With
Application.PrintOut filename:="", Range:=wdPrintAllDocument,
Item:=wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False
REPROTECTDOCUMENT
End Sub


Public Sub UNPROTECTDOCUMENT()
'Unprotect the Document
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
ActiveDocument.Unprotect
booWasProtected = True
End If
End Sub
Public Sub REPROTECTDOCUMENT()
'Protect the Document
If booWasProtected Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub


We use a variety of HP Laserjet printers from 4000's to 4200's and soon 4350.

The problem is that on some pc's the form will reset itself after being
printed. Could this be a printer driver problem or could there be a setting
in Word that causes this problem?

Any help would be appreciated

JayM
 
R

Russ

Hi,
Hi
I have some macros to enable my users to print documents quickly

The code is as follows:
Sub PRINT_THIN_P()
' PRINT_THIN_P Macro
UNPROTECTDOCUMENT
With ActiveDocument.PageSetup
.FirstPageTray = wdPrinterPaperCassette
.OtherPagesTray = wdPrinterPaperCassette
End With
Application.PrintOut filename:="", Range:=wdPrintAllDocument,
Item:=wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False
REPROTECTDOCUMENT
End Sub


Public Sub UNPROTECTDOCUMENT()
'Unprotect the Document
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
ActiveDocument.Unprotect
booWasProtected = True
End If
End Sub
Public Sub REPROTECTDOCUMENT()
'Protect the Document
If booWasProtected Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub


We use a variety of HP Laserjet printers from 4000's to 4200's and soon 4350.

The problem is that on some pc's the form will reset itself after being
printed.
What does a form do when it resets itself? Or what do mean by 'reset'?
 
J

JayM

When a form resets itself it goes back to its original state i.e. it looses
the data the user inputted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top