VBA paste clipboard picture



  • 1. Problem with Range.Text
    Hello All, I want to get text in Range object. But I am also interested in numbered list formatting. e.g. if text is 1. x 2. y I want it to be as above. Althoug Range.Text gives me only x y I realized if I save it in text file I can get numbers. Also, I figured out copy /paste preserves numbered list. but I am looking for something elegant. Is there any way to get Text in range with numbered list data??? Best Regards, Pravin A. Sable
  • 2. Using GetAddress
    Hi, I have a memo template in which I am using GetAddress to allow the user to choose names from the address book. I have two textboxes on the user form: txtTo and txtCC. I have a command button on the userform to call the address book. Here is the code I am using: Private Sub cmdTo_Click() Dim strAddress As String If txtTo = "" Then strAddress = Application.GetAddress(, , True, 1, 2, , True, True) txtTo.Text = strAddress Else strAddress = txtTo.Text & Application.GetAddress(, , True, 1, 2, , True, True) txtTo.Text = strAddress End If End Sub This shows the Select Names dialog with the To and CC boxes. The problem is this: I select several names and add them to the To box, then select several names and add to the CC box. When I click OK and come back to my userform, all of the names from both the To box and the CC Box come into the txtTo textbox on my user form. They appear in the txtTo box as follows: Amy Fox, John Doe, Snow White Jack Black, Jack Frost, John Fox I figure that I have to use the InStr function to replace the commas with paragraph marks to make a list of names. But how do I get the first list into the txtTo box and the second list into the txtCC box. Thanks for any help, Anne P.
  • 3. Symbol Codes
    I want to insert a field in a document that produces a circle. I have previously created a field that produces a diamond using {SYMBOL \f Wingdings 117 \* MERGEFORMAT}. Can you tell me where I can find the number (ANSI code?) to produce a circle instead of a diamond? -- Christina
  • 4. Using AutoText
    I have a really big problem that I hope someone can help with. I have a userform that has two textboxes, txtReLine and txtATName. The user will enter text into the first and a name into the second. When the user clicks OK, I need to create an AutoText entry in a template named Personal.dot in the startup directory. It needs to be under a category named ReLine, with the name of the entry coming from the second textbox and the value of the entry coming from the first box. All of the information that I can find on creating AutoText shows it being created from a Selection object or a Range object. Is there anyway that I can assign the value of the first textbox to a selection or range object without inserting it into a document first? This is a routine that will be used in several templates (letter and memo). I am in a big time crunch here and cannot figure out what to do. I initially thought of using an INI file or the Registry to store this information, but in all templates that will call the routine, there is a combo box which has to list the existing Re Line entries. The only way that I can figure out how to fill the combo box with those entries is to use AutoText. Can this be done, or should I be looking at a different way of doing it? Thanks for any help. Anne P.

VBA paste clipboard picture

Postby RkdN » Wed, 29 Mar 2006 01:46:05 GMT

Word 2002; windows 2000

Having a new document open and pressing a command button to run my VBA 
command: it opens a master document and copies a picture of a signature off 
the master document to the clipboard.  It closes the master document and 
returns the new document letter that I am writing.  It pastes the signature 
to the new letter.

The problem is that it does not paste it where my cursor is.  It pastes it 
at the top of the document.  Is there something in my coding that would tell 
it to paste it at the insertion point.

Thank you in advance...

Re: VBA paste clipboard picture

Postby Jezebel » Wed, 29 Mar 2006 14:55:08 GMT

Hard to say without seeing the code. Selection.Paste is normally what you 
want. A simpler method is to define the signature image as an autotext entry 
in the letter template.

Re: VBA paste clipboard picture

Postby RkdN » Wed, 29 Mar 2006 21:43:02 GMT

How do you define an image asan autotext entry?

Re: VBA paste clipboard picture

Postby Jezebel » Thu, 30 Mar 2006 06:51:21 GMT

Same way you define any other AutoText entry. Insert the image into a 
document, select it, go to Insert > AutoText ...

Similar Threads:

1.Using VBA to load a picture and paste it to the clipboard

2.PPT How do I paste clipboard info to a specific location with VBA

I want paste specific ranges in an Excel spreadsheet to a 
powerpoint slide at a specific location on the slide. I 
have sucessfully pasted to a slide but I cannot figure out 
how to position the pasted item where I want it.

3.Edit Picture (pasted from clipboard)

I've searched for an answer to this but the ones I've found don't
exactly work.  Let's say I have an app that is set at 640x480.  I want
to paste a screenshot into WinWord.  So, I Alt-PrtScn when it's
active, and paste it into WinWord.

Now here's the problem.  Let's say I want to extract the bitmap back
out, or just edit it a little with pixel resolution (i.e. get exactly
my same 640x480 back out).  If I right click on it, the "Edit Picture"
button is disabled.  Strangely enough, if the picture is very small,
the "Edit Picture" is enabled and launching it brings MS PaintBrush
(which is what I want for the bigger picture).

I'm guessing Microsoft is compressing larger images and making the
compression lossy.

I don't want lossy compression and I want to be able to edit the
original 640x480 painted image.  As it is now, I can't get back out
the same quality of the image I put in.  It's "lossy" (blah!).

Any ideas?  Thanks.

4.Paste clipboard item to field through VBA?

Whoops! What a noobie's mistake that was! Thanks Dirk. I feel rather sheepish right now

I did find anotherissue, but I will take it over to the Word forum, as my Access problems have been fixed. Thank you all! :)

5.How do I paste from clipboard to range using Excel VBA

I have just moved from Windows 2000 & Office 2002 (Old) to XP Pro and Office 
2003 (New).  The following statements work in the old version and also  in 
the new version when I step through the code using the debugger.  They fail 
when I try and run the macro in the new version.

Dim oSheet As Worksheet
' copy text to windows clipboard
' error generated on the above stating "Paste method of Worksheet Class 

6. Pasting from the clipboard to the address box of inserthyperlink dialog window in vba

7. Pasting from Excel Clipboard with VBA Macro

8. Paste from clipboard via VBA

Return to MS WORD


Who is online

Users browsing this forum: No registered users and 25 guest