S
Sasquatch
I'm back again
As previously suggested, I've used the code from
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116 to control
the duplex property of my printer. It will in fact turn on the duplex option
as intended, but once it does so it won't turn it back off, even though it
says it did (through message box responses). Here is the code from my
Document_Open and _Close events:
========================================
Private lngOrigSetting As Long
Private boolOptionChanged As Boolean
Private Sub Document_Open()
'* retrieve the original duplex setting
lngOrigSetting = GetDuplex
MsgBox "Retrieved: " & lngOrigSetting
'* turn on duplex if it isn't already on
If lngOrigSetting <> 2 Then
SetDuplex 2
boolOptionChanged = True
MsgBox "After setting, retrieved: " & GetDuplex
Else
boolOptionChanged = False
MsgBox "Duplex already on"
End If
End Sub
Private Sub Document_Close()
Dim lngCurrSetting As Long
If boolOptionChanged Then
'* retrieve the current setting
lngCurrSetting = GetDuplex
MsgBox "Retrieved: " & lngCurrSetting
'* if current setting <> original setting then reset it
If lngCurrSetting <> lngOrigSetting Then
MsgBox "Resetting to: " & lngOrigSetting
SetDuplex lngOrigSetting
MsgBox "After setting, retrieved: " & GetDuplex
End If
End If
End Sub
========================================
So, when I open the document the message boxes tell me:
Retrieved: 1
After setting, retrieved: 2
If I check the File/Print.../Properties the duplex option is on and it will
print double sided. When I close the document the message boxes tell me:
Retrieved: 2
Resetting to: 1
After setting, retrieved: 1
Now, if I reopen the document and close it I get the same messages, telling
me it is turned on and back off, *BUT* if I open any other file (Word, Excel,
whatever) it will still duplex print it. If I open the document it will give
me the same series of messages...turned on...turned off.
I tried it on all 3 of our networked printers (all 3 are RICOH Aficio 1075
PCL 6) and I get the same results on each printer. If I go to the printer
window from the control panel and check the printer's properties it will say
that duplex is off but when I reopen anything it will still print it duplexed.
Any help would be greatly appreciated...I've been at this for a few days.
Ultimately I'd like to use the above code for documents with more than 5
pages so that they automatically duplex print w/o any user interaction.
Thanks in advance...
As previously suggested, I've used the code from
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116 to control
the duplex property of my printer. It will in fact turn on the duplex option
as intended, but once it does so it won't turn it back off, even though it
says it did (through message box responses). Here is the code from my
Document_Open and _Close events:
========================================
Private lngOrigSetting As Long
Private boolOptionChanged As Boolean
Private Sub Document_Open()
'* retrieve the original duplex setting
lngOrigSetting = GetDuplex
MsgBox "Retrieved: " & lngOrigSetting
'* turn on duplex if it isn't already on
If lngOrigSetting <> 2 Then
SetDuplex 2
boolOptionChanged = True
MsgBox "After setting, retrieved: " & GetDuplex
Else
boolOptionChanged = False
MsgBox "Duplex already on"
End If
End Sub
Private Sub Document_Close()
Dim lngCurrSetting As Long
If boolOptionChanged Then
'* retrieve the current setting
lngCurrSetting = GetDuplex
MsgBox "Retrieved: " & lngCurrSetting
'* if current setting <> original setting then reset it
If lngCurrSetting <> lngOrigSetting Then
MsgBox "Resetting to: " & lngOrigSetting
SetDuplex lngOrigSetting
MsgBox "After setting, retrieved: " & GetDuplex
End If
End If
End Sub
========================================
So, when I open the document the message boxes tell me:
Retrieved: 1
After setting, retrieved: 2
If I check the File/Print.../Properties the duplex option is on and it will
print double sided. When I close the document the message boxes tell me:
Retrieved: 2
Resetting to: 1
After setting, retrieved: 1
Now, if I reopen the document and close it I get the same messages, telling
me it is turned on and back off, *BUT* if I open any other file (Word, Excel,
whatever) it will still duplex print it. If I open the document it will give
me the same series of messages...turned on...turned off.
I tried it on all 3 of our networked printers (all 3 are RICOH Aficio 1075
PCL 6) and I get the same results on each printer. If I go to the printer
window from the control panel and check the printer's properties it will say
that duplex is off but when I reopen anything it will still print it duplexed.
Any help would be greatly appreciated...I've been at this for a few days.
Ultimately I'd like to use the above code for documents with more than 5
pages so that they automatically duplex print w/o any user interaction.
Thanks in advance...