ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print a user form image (https://www.excelbanter.com/excel-programming/438533-print-user-form-image.html)

Alberto Ast[_2_]

Print a user form image
 
I learn how to print a text as follows

Private Sub CommandButton3_Click()
Dim intOutFile As Integer 'number for the output file
intOutFile = FreeFile 'get a file number
Open "c:\temp\temp.txt" For Output As intOutFile
Print #intOutFile, Print_Dev.TextBox1.Text
Close intOutFile
Shell "c:\windows\notepad.exe /P c:\temp\temp.txt"
Kill "c:\temp\temp.txt" 'delete the file if desired
End Sub

Now I would like to print an image as well... I tried modifying this

Print #intOutFile, Print_Dev.TextBox1.Text

for this

Print #intOutFile, Print_Dev.image1.picture, Print_Dev.TextBox1.Text

but did not work... it just print a series of numbers.

Any idea?

JLGWhiz[_2_]

Print a user form image
 
From VBA help file:

Private Sub UserForm_Click()
UserForm1.PrintForm
End Sub




"Alberto Ast" wrote in message
...
I learn how to print a text as follows

Private Sub CommandButton3_Click()
Dim intOutFile As Integer 'number for the output file
intOutFile = FreeFile 'get a file number
Open "c:\temp\temp.txt" For Output As intOutFile
Print #intOutFile, Print_Dev.TextBox1.Text
Close intOutFile
Shell "c:\windows\notepad.exe /P c:\temp\temp.txt"
Kill "c:\temp\temp.txt" 'delete the file if desired
End Sub

Now I would like to print an image as well... I tried modifying this

Print #intOutFile, Print_Dev.TextBox1.Text

for this

Print #intOutFile, Print_Dev.image1.picture, Print_Dev.TextBox1.Text

but did not work... it just print a series of numbers.

Any idea?




Alberto Ast[_2_]

Print a user form image
 
Thanks... it does not print as good as previous function but it does it as
requeste...


"JLGWhiz" wrote:

From VBA help file:

Private Sub UserForm_Click()
UserForm1.PrintForm
End Sub




"Alberto Ast" wrote in message
...
I learn how to print a text as follows

Private Sub CommandButton3_Click()
Dim intOutFile As Integer 'number for the output file
intOutFile = FreeFile 'get a file number
Open "c:\temp\temp.txt" For Output As intOutFile
Print #intOutFile, Print_Dev.TextBox1.Text
Close intOutFile
Shell "c:\windows\notepad.exe /P c:\temp\temp.txt"
Kill "c:\temp\temp.txt" 'delete the file if desired
End Sub

Now I would like to print an image as well... I tried modifying this

Print #intOutFile, Print_Dev.TextBox1.Text

for this

Print #intOutFile, Print_Dev.image1.picture, Print_Dev.TextBox1.Text

but did not work... it just print a series of numbers.

Any idea?



.



All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com