Solved

in vb4 'printform '

Posted on 1998-06-06
13
327 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 9

Accepted Solution

by:
Dalin earned 200 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

832 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