Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print clipboard Contens
I have a tif image that I copy and load into a form to view, I would like to
print it how can I send this copied info to the printer?. Any help will be much appreciated. Regards Charles |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print clipboard Contens
I don't know if this snippet from Chip Pearson is what you need or not.
Set a reference to the MSForms 2.0 library, and use code like the following: Dim DObj As MSForms.DataObject Dim S As String Set DObj = New MSForms.DataObject DObj.GetFromClipboard S = DObj.GetText Debug.Print S "vqthomf" wrote: I have a tif image that I copy and load into a form to view, I would like to print it how can I send this copied info to the printer?. Any help will be much appreciated. Regards Charles |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print clipboard Contens
One way would be to copy the image to an image control on an otherwise empty
sheet and print the sheet. Following adds an image control to Sheet1 (if it doesn't already exist) and copies the picture from the image control on the form. I haven't included code to print the sheet but you can adapt that from a recorded macro. First you may want to check things like picture size and stretch properties, border, etc. Private Sub CommandButton1_Click() Dim ole As OLEObject Dim ws As Worksheet Dim img As Image Set ws = Worksheets("Sheet1") ' < some empty sheet On Error Resume Next Set img = ws.OLEObjects("imgPrint") On Error GoTo 0 If ole Is Nothing Then Set ole = ws.OLEObjects.Add("forms.image.1") ole.Name = "imgPrint" End If ole.Visible = True Set img = Me.Image1 ' < change to suit Set ole.Object.Picture = img.Picture With ole .Left = 0 .Top = 0 .Object.AutoSize = True End With End Sub Regards, Peter T "vqthomf" wrote in message ... I have a tif image that I copy and load into a form to view, I would like to print it how can I send this copied info to the printer?. Any help will be much appreciated. Regards Charles |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? | Setting up and Configuration of Excel | |||
Clipboard empty but still get waring that clipboard is full | Excel Discussion (Misc queries) | |||
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? | Excel Programming | |||
Restore clipboard from Task pane clipboard content? | Excel Programming | |||
ClearContents or ClearFormats also clears Clipboard. How can I keep the clipboard? | Excel Programming |