Jonathan West re Duplex Macros

T

Tonya Marshall

Hi Jonathan,

I'm still fiddling with the macros. I want one for Booklet (vertical
binding) and one for Tablet (horizontal binding) printing. I put a 3 in
one for booklet printing and a 2 (it was a guess) for Tablet printing.
They both do booklet printing.

The paper has 5 holes punched at the top for charts and both of them
print with the holes at the bottom. Standard printing prints with them
at the top.

What I need is to turn the pages 180 degrees so that they print with the
holes at the top. I thought about experimenting with putting different
numbers in the macros but since it's not my printer I don't feel quite
right about that. I don't expect that I could harm the printer but would
like to know if there's a range of numbers to try.

I can manually set the printer for vertical and horizontal binding and
turn them 180 degrees so that they print out correctly but there are no
numbers or anything to indicate what each setting is.

Thanks.
 
T

Tonya Marshall

I downloaded the Manual for the printer and copied this out of it:

3 Flip Pages Sideways
(long-edge portrait)
This is the default and most common layout, with every
printed image oriented right-side up. Facing pages are read
from top to bottom on the left page, then from top to bottom
on the right page.

4 Flip Pages Up
(short-edge portrait)
This layout is often used with clipboards. Every other printed
image is oriented upside-down. Facing pages are read
continuously from top to bottom.

I think what I must do is change the order of the printing, which I can
do manually in the printer settings, and print the second page first
which would be the same as rotating them 180º, so I would need VBA code
to do that in the printer macro. I will try 4 in the Tablet code
tomorrow at work.

1 & 2 are for Landscape settings.

Tonya Marshall
 
J

Jonathan West

Hi Tonya,


Tonya Marshall said:
I downloaded the Manual for the printer and copied this out of it:

Exactly which version of the HP2300 are you using? Not all models have the
ability to print duplex.
3 Flip Pages Sideways
(long-edge portrait)
This is the default and most common layout, with every
printed image oriented right-side up. Facing pages are read
from top to bottom on the left page, then from top to bottom
on the right page.

4 Flip Pages Up
(short-edge portrait)
This layout is often used with clipboards. Every other printed
image is oriented upside-down. Facing pages are read
continuously from top to bottom.

I think what I must do is change the order of the printing, which I can do
manually in the printer settings, and print the second page first which
would be the same as rotating them 180º, so I would need VBA code to do
that in the printer macro. I will try 4 in the Tablet code tomorrow at
work.

1 & 2 are for Landscape settings.

I think I have found the point in the manual you are referring to - page 44
of the User Guide.

The numbers on the diagrams in the manual have nothing to do with the
numbers you feed into the routines.

It might be that you need to set the paper orientation in the printer
driver. I didbn't include this in the original artyicle, because Word
normally copes with this unassisted by means of setting the orientation in
the Page Setup dialog. Try adding the following code to the printing module


Public Sub SetOrientation(iOrient As Long)
SetPrinterProperty DM_ORIENTATION, iOrient
End Sub

Public Function GetOrientation() As Long
GetColorMode = GetPrinterProperty(DM_ORIENTATION)
End Function


You can set the orientation like this

SetOrientation 1 ' sets portrait layout
SetOrientation 2 ' sets landscape layout

Normally, setting this property is over-ridden by the Page Setup settings in
Word (which is why I didn't include it in the original article), but it
might be that in your case you need this in order to bully the printer into
getting the combination or orientation and duplex that you want.
 
T

Tonya Marshall

Jonathan said:
Hi Tonya,




Exactly which version of the HP2300 are you using? Not all models have the
ability to print duplex.


I think I have found the point in the manual you are referring to - page 44
of the User Guide.

The numbers on the diagrams in the manual have nothing to do with the
numbers you feed into the routines.

It might be that you need to set the paper orientation in the printer
driver. I didbn't include this in the original artyicle, because Word
normally copes with this unassisted by means of setting the orientation in
the Page Setup dialog. Try adding the following code to the printing module


Public Sub SetOrientation(iOrient As Long)
SetPrinterProperty DM_ORIENTATION, iOrient
End Sub

Public Function GetOrientation() As Long
GetColorMode = GetPrinterProperty(DM_ORIENTATION)
End Function


You can set the orientation like this

SetOrientation 1 ' sets portrait layout
SetOrientation 2 ' sets landscape layout

Normally, setting this property is over-ridden by the Page Setup settings in
Word (which is why I didn't include it in the original article), but it
might be that in your case you need this in order to bully the printer into
getting the combination or orientation and duplex that you want.
Thanks Jonathan,
I'll give it a try when I get to work.
 
T

Tonya Marshall

Jonathan said:
Hi Tonya,




Exactly which version of the HP2300 are you using? Not all models have the
ability to print duplex.


I think I have found the point in the manual you are referring to - page 44
of the User Guide.

The numbers on the diagrams in the manual have nothing to do with the
numbers you feed into the routines.

It might be that you need to set the paper orientation in the printer
driver. I didbn't include this in the original artyicle, because Word
normally copes with this unassisted by means of setting the orientation in
the Page Setup dialog. Try adding the following code to the printing module
I have 3 modules in the Duplex template
Printer - do the 2 public subs go in here? It's the macro that starts,
Option Explicit
Booklet - Set orientation1 in here?
Tablet - Set orientation2 in here?
Public Sub SetOrientation(iOrient As Long)
SetPrinterProperty DM_ORIENTATION, iOrient
End Sub

Is this the one that turns the pages 180°?
Public Function GetOrientation() As Long
GetColorMode = GetPrinterProperty(DM_ORIENTATION)
End Function

It's not a color printer.
You can set the orientation like this

SetOrientation 1 ' sets portrait layout
I expect the above is for booklet layout?
SetOrientation 2 ' sets landscape layout
Landscape would turn the pages 90°, not 180°

I didn't want landscape, I wanted horizontal binding on a portrait layout
 
J

Jonathan West

Hi Tonya,

before we go any further with this, it is possible to go into the Printer
properties dialog and set the duaplxing manually to the way you want it? If
not, then all the messing about with code will not achieve what you are
trying to do.
 
T

Tonya Marshall

Jonathan said:
Hi Tonya,

before we go any further with this, it is possible to go into the Printer
properties dialog and set the duaplxing manually to the way you want it? If
not, then all the messing about with code will not achieve what you are
trying to do.
Yes. I think I mentioned that in my first post.
I can set it for both horizontal and vertical binding, then I can set it
to turn the pages 180 degrees if I need to. (That's what I do when I use
the paper drawer with the 5-hole punched paper so that the holes are at
the top of the page when it's printed.
 
J

Jonathan West

Tonya Marshall said:
Here is an image of the printer properties. Don't know if it will be
helpful or not but thought I'd stick it in:
http://img91.exs.cx/my.php?loc=img91&image=image101.jpg

That 180 degree flip is not part of the standard printer API in Windows.
That means that if you want programmatic access to that feature, you'll have
to contact HP and ask about the API. I'm not all that optimistic of your
chances of getting anywhere with them.

I suspect that the only way to handle this in code may be to define two
copies of the pronter with different names, but both pointing to the same
physcial device. Configure one as duples with the settings you want, and the
other as non-duplex. Then set the ActivePrinter property to one or the other
for the printing you want.
 
T

Tonya Marshall

Jonathan said:
That 180 degree flip is not part of the standard printer API in Windows.
That means that if you want programmatic access to that feature, you'll have
to contact HP and ask about the API. I'm not all that optimistic of your
chances of getting anywhere with them.

I suspect that the only way to handle this in code may be to define two
copies of the pronter with different names, but both pointing to the same
physcial device. Configure one as duples with the settings you want, and the
other as non-duplex. Then set the ActivePrinter property to one or the other
for the printing you want.
Thanks, Jonathan. I appreciate the time you've spent on this. I can't
set the active printer property to something different as we get forms
printed from the AS400 and the standard print configuration is the one
they start from. I know they have control of the printer because what we
receive is printed correctly from the 5-hole punched paper drawer. Maybe
I could ask them what they do/use to make the configurations work.
 
T

Tonya Marshall

Jonathan said:
That 180 degree flip is not part of the standard printer API in Windows.
That means that if you want programmatic access to that feature, you'll have
to contact HP and ask about the API. I'm not all that optimistic of your
chances of getting anywhere with them.

I suspect that the only way to handle this in code may be to define two
copies of the pronter with different names, but both pointing to the same
physcial device. Configure one as duples with the settings you want, and the
other as non-duplex. Then set the ActivePrinter property to one or the other
for the printing you want.
Since that is not going to be possible, I can put a Quick Set Tablet
and Booklet feature with pages turned 180 degrees. What would be useful
would be a macro to return the printer to the default setting so we
don't have to go in and turn the feature off. I fear most would forget
as I have from time to time.
Thanks.
 

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