Solved

Printer (Next Page)

Posted on 2004-09-13
19
793 Views
Last Modified: 2008-01-09
Hello,

I am presently trying to print my Customer's information on a WayBill for shipping.

The waybill is about 4" wide by 10.2" Long ( 110 mm x 280 mm)

I am using the following code to print my info.

Printer.Height = 4 * 1440 ' 10 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 5 inch height x 1440 twips per inch

Printer.Font.Size = 10
Printer.CurrentX = 20
Printer.CurrentY = 1650
Printer.Print Me.TextDestinaire.Text

Printer.CurrentX = 20
Printer.CurrentY = 2100
Printer.Print Me.TextAdresse.Text

Printer.CurrentX = 3800
Printer.CurrentY = 2100
Printer.Print Me.TextApp.Text

Printer.CurrentX = 20
Printer.CurrentY = 2600
Printer.Print Me.TextVille.Text

Printer.CurrentX = 2000
Printer.CurrentY = 2600
Printer.Print Me.TextProvince.Text


Printer.CurrentX = 3400
Printer.CurrentY = 2600
Printer.Print Me.TextPostal.Text

Printer.EndDoc

The code runs fine.  However after the EndDoc statement, the printer scrolls through 3 - 4 waybills before stopping and this does not re-align the printhead for the next waybill printing.  Is there a way to tell the printer how many line to jump before stopping or is there a way to make the printer head always align with the next waybill since the paper size is already defined?

I am printing on a dotMatrix Okidata ML 420 since waybills comes on continuous paper.

Thanks for your help.

Mark
0
Comment
Question by:markrhyman
  • 9
  • 8
  • 2
19 Comments
 
LVL 32

Expert Comment

by:Erick37
ID: 12048757
Printer.Height = 4 * 1440 ' 10 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 5 inch height x 1440 twips per inch

Your comments above suggest you have the height and width transposed.
0
 

Author Comment

by:markrhyman
ID: 12049653
That's true.  I did make the change to:

Printer.Height = 4 * 1440 ' 5 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 10 inch height x 1440 twips per inch

Still the problem lies after the printing is done.
0
 
LVL 7

Expert Comment

by:_agj_
ID: 12052534
try the

Printer.NewPage method?
0
 
LVL 7

Expert Comment

by:_agj_
ID: 12052556
0
 

Author Comment

by:markrhyman
ID: 12054846
It seems that I am having trouble setting the papersize.

Check this:

Printer.Height = 4 * 1440  ' 4 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 10.2 inch Width x 1440 twips per inch

In the Watch Windows I get:

Printer.Height = 15840
Printer.Width = 12240

Which is totally not what I want.

I even tried to set the printer.papersize = 256 and I get a Runtime Error.

I think this is why I can't have the nextpage aligned correctly.

Any help why I cannot set the Page Size?

Mark
0
 
LVL 32

Expert Comment

by:Erick37
ID: 12055320
From MSDN:

"Setting a printer's Height or Width property automatically sets PaperSize to vbPRPSUser [256].

Note   The effect of the properties of the Printer object depends on the driver supplied by the printer manufacturer. Some property settings may have no effect, or several different property settings may all have the same effect. Settings outside the accepted range may or may not produce an error. For more information, see the manufacturer's documentation for the specific driver."


In the printers dialog (from Windows) what paper size and orientation is selected for this printer?  Is this the default printer?



0
 

Author Comment

by:markrhyman
ID: 12057278
Yes this is the default Printer.

The driver is correct and is the latest one downloaded from Okidata.

I am not using the PRinter Dialog for this printing.

0
 
LVL 32

Expert Comment

by:Erick37
ID: 12057419
I understand. But as a test, can you set the paper size through Windows and not your code.  Comment out the .height and .width lines and test printing.
0
 

Author Comment

by:markrhyman
ID: 12057454
The closest match for the Height would be Envelope DL but there's no Envelope DL in the properties of the printer.  I tried Envelope #10 which is close to what I want.  The Width and Height changed to the size of the Env #10 in the Watch window in VB.

However, the printer still skips 3 waybills after finishing printing the first one.

This is a mess.  I really need some solution.  I cannot imagine that this cannot be done.

Mark
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:markrhyman
ID: 12057619
I did that,

Same story.  Still skips 3 Waybills.

0
 
LVL 32

Expert Comment

by:Erick37
ID: 12057652
Here's how to setup custom paper sizes in Windows 2k, XP:
http://my.okidata.com/idocs2.nsf/(MOC-ML420)/54E6115E5DBD742C852569B30060485C?OpenDocument

I'm assuming a program like MS Word can print correctly to this printer?
0
 
LVL 32

Expert Comment

by:Erick37
ID: 12057727
0
 

Author Comment

by:markrhyman
ID: 12058745
Erick37, I really appreciate your help but I also tried to follow the steps mentionned in the link above.  However the newly created form appreas nowhere.  

Give it a try and let me know if you create a newform and if you can see it in the printer properties afterwards.

I definitely have to get a solution.
0
 
LVL 32

Expert Comment

by:Erick37
ID: 12059104
It seems to be driver specific...

It appears in the Acrobat Distiller dropdown, but not the HP Laserjet.  Sorry it wasn't helpful.
0
 
LVL 32

Expert Comment

by:Erick37
ID: 12059896
Ok, here's another thought...

Your printer has a feature called "Forms Tear-Off."  Make sure it's not enabled.


"The Forms Tear-Off feature allows a printed continuous forms page to be torn off without wasting paper or adjusting the printer.

When printing stops, Forms Tear-Off automatically moves the paper to align the perforation with the tear bar (located under the access cover), after a time interval which you select through the menu.

Paper remains in the tear-off position until the printer receives more data. Then, the paper moves back down for printing.

Note: This feature is normally turned off."
0
 

Author Comment

by:markrhyman
ID: 12067433
I will have to go through the manual because there's a Button on the printer Tear but when I press on this button it aligns the paper to be torn off.

I dunno how to disable this function.

0
 
LVL 32

Accepted Solution

by:
Erick37 earned 400 total points
ID: 12067525
The setup menu on the printer also allows you to select the paper length (11"(default), 11-2/3", 12", 14", 17", 5", 3.5", 4", 5.5", 6", 7", 8", 8.5").  You may need to do this in order for your forms to align correctly.  It seems that the printer driver is rejecting your attempts to set the page size.
0
 

Author Comment

by:markrhyman
ID: 12070055
I wrote to Okidata today in order to know how can I set up a custom form size in the printer.  I even switched to another printer but I ran through the same problem.

This situation is exasperating.

If you find any other solution let me know.  I am willing to raise the points again in order to find a working solution.

Thanks a lot for your support.
0
 

Author Comment

by:markrhyman
ID: 12076179
Here's the answer from Okidata.  The printer Driver was the problem.  I had to use another one that would accept the created form (Emulation).  Erick37 you were of great help I am going to award you the points.  Thanks.

--------------------------------------  

Mark,

Thank you for your recent inquiry.

I've included instructions on how to create a custom form below.

Before beginning, make sure the Okidata printer is set as default in Windows.

Go to START/SETTINGS/PRINTERS, highlight the printer and select FILE in the upper left corner, and click on SERVER PROPERTIES. In the Print Server Properties window check the box "Create New Form", this will allow you to provide a name for the form. Next, set the form parameters under the Measurements section. Click Save Form and your newly created form will appear in the box above.

Now close the Window.

Next click on File and then click on Printing Preferences. Under the Layout Tab click on the Advanced button. Select the form you just created from the drop down list under Paper Size. Click OK and Close the Printer Preferences window.

Next right click on the printer icon that you will use with the newly created form. Click on Properties and then on the Device Settings tab. Select the form from the drop down list and apply the changes.

The newly created form is now set as the default paper size within the selected Print Driver.

If you continue to have problems, please try an alternate driver. Load the Epson FX 286 driver which is native in Windows. Make sure the emulation of the driver matches the printer.


If we can do anything else for you in the future, please don't hesitate to ask! Also, you may be interested to know that Oki Data has now launched my.okidata.com, which allows you to access Personalized Solutions information for all your Oki Data Products.

Your Personal Solutions Specialist
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now