Print an image from a userform

Phillip2

Board Regular
Joined
Aug 5, 2019
Messages
79
Office Version
  1. 365
Platform
  1. Windows
I have a userform with two pages. The second page only contains an image. This image changes depending on the customer's record number.
I am trying to write a macro that will scale this image down to fit on an standard 8 x 11 1/2 sheet and send the file to a printer.
The following is the macro that I'm using to place the image into the form.

VBA Code:
'____________Page 2 Call Tree Frame________________________


'Inserts a picture of the Call Tree on Page two
callTree.Picture = LoadPicture("Y:\Phillip\CCX Applications\Images\" & TBrecord.Text & ".jpg")
End If
Next
End Sub

I have tried several things just to try and make it print the form. I really need for it to bring up a printer setup box, in case I need to change the orientation.
However, the best that I can get it to do is printing about half of the form's first page in a portrait orientation.


VBA Code:
'____________Print Button________________________


Private Sub printButton_Click()
Dim RetStat
RetStat = Application.Dialogs(xlDialogPrinterSetup).Show
If RetStat Then Me.PrintForm
End Sub


All I actually want to print is the image that is on page two.

Any help would be appreciated.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top