Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 0 May 5th 09 01:20 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? tskogstrom Excel Programming 2 March 6th 07 12:50 PM
Restore clipboard from Task pane clipboard content? tskogstrom Excel Programming 0 January 30th 07 10:48 AM
ClearContents or ClearFormats also clears Clipboard. How can I keep the clipboard? [email protected] Excel Programming 5 December 16th 05 02:30 AM


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"