Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing printer (& forum search)

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
0
0
GB
I've got the a list of available printers installed on the system, that was easy but how do I select which one is going to be used by my application. I dont want to change the windows default though.

Oh and now that the search facility is back up all my searches search through every forum whixh isn't too helpful! Anyone know what I'm doing wrong there?
 
This is actually the first time I've tried printing in VB so I've run into a few problems. I want to print out four photos with text onto a sheet of paper.

I've laid this out on a form and used print form but it comes out smaller than the page. Is it not possible to stretch this to fit a page?

The form is made up of image control. However, if I load a very big picture into them and then print them out will the printed resolution be lowered because the actual picture printed is a small bitmap image craeted by the image control?

Am I going about this the wrong way? I need to be pointed in the right direction I think.

Many thanks

elziko
 
To select the printer from the collection, use the following syntax:

Set Printer = Printers(n)

The following statements print the device names of all the printers on the operating system to the Immediate window:

Private Sub Command1_Click()
Dim x As Printer
For Each x In Printers
Debug.Print x.DeviceName
Next
End Sub

I hope this help you .... :)
 
As far as I know, if you use Print.Form it will print the Form as it apears on screen. Suggestion:

just before you select the printer,
set the Image.height and image.width to that of the Form and remove all other buttons and such (except for the Label--if you're using it as the picture's caption that is)

ex:
With Image1
PrevImgHt = .Height
PrevImgWd = .Width
.height = Form1.Height
.width = Form1.width
End With
(all other objects).Visible = False
[call your printing routine]

'restore Form and Image
(all other objects).Visible = True
With Image1
.height = PrevImgHt
.width = PrevImgWd
End With

Hope this helps also, if so, let us know by clicking below.
-MiggyD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top