Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

in vb4 'printform '

Posted on 1998-06-06
13
Medium Priority
?
360 Views
Last Modified: 2010-05-03
In vb4, I am trying to print the ENTIRE form to a standard 8 x 11 page on the printer. If the form that I am printing is in the MAX size, but NOT on the monitor (hidden with another form) , the printer ONLY reproduces the designated form in its NORMAL size.. thus, cutting of a great portion of the data on the form.  However , if the form is visible, the printer WILL reproduce ALL of  the data. How can I get the printer to print ALL of the form w/o having the form on the monitor?

Question #2. How do I get the data to FILL the 8x 11 page
so it looks more professional as upposed to only a half page and a LOT of empty space. In other words how do I streach the data and Fill the page?
0
Comment
Question by:hjaycox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 

Author Comment

by:hjaycox
ID: 1462692
Edited text of question
0
 
LVL 2

Expert Comment

by:evertd
ID: 1462693
It is not possible!
0
 

Author Comment

by:hjaycox
ID: 1462694
Nothing is impossible .there is an answer
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Accepted Solution

by:
Dalin earned 800 total points
ID: 1462695
hjaycox,
Try this. If you have problems, let me know.
Regards
Dalin


Sub PrintMyForm()

myForm.Width =Printer.ScaleWidth
myForm.Height=Printer.ScaleHeight
myForm.PrintForm

End Sub()
0
 

Author Comment

by:hjaycox
ID: 1462696
Dalin:
I am stupid... need idiots clarification

myForm.Width =Printer.ScaleWidth
myForm.Height=Printer.ScaleHeight

What do I insert for the printer.scaleWidth and Printer.scaleheight? A # and if so what #. Or just the exact wording?  
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1462697
hjaycox,
Don't feel bad. We all have things that we don't know. No one knows everything.

 Printer is a global object and scalewidth and scaleheight are two properties of the printer object. once your printer is set (in windowsor VB), these properties are available. You just putiiing the exact wording.
This will print the form in a full page. However, for some of the controls, its content can not be printed. Try this, if it does not do what you need, let me know.
Regards
Dalin
0
 

Author Comment

by:hjaycox
ID: 1462698
thanks you do GOOD WORK.  I Knew there was an answer
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1462699
Thank you for the comments, hjaycox. I am glad it worked out.
Good luck in your project
Regards
Dalin

0
 

Author Comment

by:hjaycox
ID: 1462700
Is it possible to streach and fill to a 8 x 11 page  data from a visible form that, when printed to the printer only uses up 1/2 the printed page. This program is written in vb5. The above info that you gave works in vb4, but I get an error in vb5. Extra points to you on this one. ALSO see New question "Kill a COMMAND BUTTON "

0
 

Author Comment

by:hjaycox
ID: 1462701
Dalin here is a slam bang " IF exist" solution
on error goto 1
open "diR:\FILENAME.EXT" FOR INPUT AS #1
CLOSE #1
1 MSGBOX, " NO FILE EXISTS",,IB
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1462702
hjaycox,
I just printed a copy of mine in VB5, it works OK.
The problems with this methods is that the content of some controls can not be printed. Another way is that you use the printer object and specify everything you want to print. However, this requires a considerable amount of code. If you are interested, email me at Dalin_N@Mailexcite.com.

The fileexisting solution you have here is incomplete.  If ta file exist but is open by another app, it will return an error when you try to open it, so you will get an answer of "not exist".

You can use the Dir function.

Dim lfile as String
lFile = Dir(yourFileWithPath)
If lFile = yourFile then
'     fileExist
   
Regards
Dalin


0
 

Author Comment

by:hjaycox
ID: 1462703
this slam is just to see if ythere is such a file.. not to open it with another app.

i will try the above and if Istill get an error ... will call back
thanks
seeyabye
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1462704
hjaycox,
I guess I did not make myself clear.

Try this:
1. Open a file with notepad,
2. Run your code
3. you will get "File not exist", False!

Regards
Dalin

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

664 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