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
Solved

in vb4 'printform '

Posted on 1998-06-06
13
331 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
message box in access 4 51
MS SQL store procedure to calculate and return result 6 62
VBA - If Bookmark = "XXBOOKMARKXX" then 15 40
checkbox to hide entire section 10 40
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

808 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