Paste text as inline picture/shape

S

Susan B. Quinn

I have managed to write a macro for inserting text as a picture but I wanted
the picture to automatically sit inline with text. How would I go about doing
that?
 
J

Jezebel

If you insert it as an InlineShape (as opposed to a Shape), inline is how it
will be.
 
S

Susan B. Quinn

I may not be explaining myself very well. I know what I need to do but i
can't get the correct code to do that.

I am a bit of a bumbler when it comes to code. Was wondering if anyone could
help with the code. Currently this is what I have:

Sub pastepicture()

Selection.Collapse Direction:=wdCollapseStart
Selection.Range.PasteSpecial DataType:=wdPasteInlineShape

End Sub

and it is floating over text.
 
J

Jezebel

Where is the picture coming from? If it's from a file, use something like

ActiveDocument.InlineShapes.Addpicture FileName:="c:\....", Range:=Selection
 
S

Susan B. Quinn

OK. Let's start at the beginning. I want to write a macro that:

1. Pastes the content of the clipboard into the document as a picture
(enhanced metafile) The content is always text from another Word document.

2. Makes the resulting picture sit inline with text.

So far I have managed to write code that drops the text in as a picture. But
I can't work out how to make it then change to being inline with text.

This is the code I have so far:

Sub pastepicture()

I currently have my options set in Word to insert all pictures in as "In
Line With Text"
This does not always work with pastespecial from the clipboard.

Susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top