PasteSpecial with Graphics

A

Andreas Borrmann

Hi

I had the following macro in Word 97. It was supposed to insert PowerPoint graphics into my text and worked perfectly fine. Since I converted to Word 2000 this macro failed to insert my graphics. A newly recorded macro failed to insert the graphics inline into the text (handled like normal characters) but placed it over the text. I used the recording way to produce this new macro and the graphics-placement dialog disabled the option for the inline placement during the recording period. Afterwards I was able to set the inline placement manually

Waht can I do to integrate this into the macro??

Thanks, Andrea

Sub AlsNormtextEinfügen(
Selection.PasteSpecial Link:=False, DataType:=wdwdPasteEnhancedMetafile, Placement:=
wdInLine, DisplayAsIcon:=Fals
End Sub
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?QW5kcmVhcyBCb3JybWFubg==?=,

Well, when I look at the macro, it already specifies wdInLine for the Placement
argument, so theoretically it should work as it stands? You say this is the macro
from Word 97. How does the one your recorded in Word 2000 differ (please post that
code)?
I had the following macro in Word 97. It was supposed to insert PowerPoint
graphics into my text and worked perfectly fine. Since I converted to Word 2000
this macro failed to insert my graphics. A newly recorded macro failed to insert
the graphics inline into the text (handled like normal characters) but placed it
over the text. I used the recording way to produce this new macro and the
graphics-placement dialog disabled the option for the inline placement during the
recording period. Afterwards I was able to set the inline placement manually.
Waht can I do to integrate this into the macro???

Thanks, Andreas

Sub AlsNormtextEinfügen()
Selection.PasteSpecial Link:=False, DataType:=wdwdPasteEnhancedMetafile, Placement:= _
wdInLine, DisplayAsIcon:=False
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :)
 
A

Andreas Borrmann

Now I got it:

The following Code (written with Word 2000 VBA Editor) placed the graphics over the text (as if "wdFloatOverText" was used):

Sub PasteInline()
Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, _
Placement:=wdInLine, DisplayAsIcon:=False
End Sub

But the following code did the trick:

Sub PasteInline2()
Selection.PasteSpecial Link:=False, DataType:=wdPasteEnhancedMetafile, _
Placement:=wdInLine, DisplayAsIcon:=False
Selection.ShapeRange.ConvertToInlineShape
End Sub

The weird thing is: I was not able to assign the inline-placement while recording the macro (only manually afterwards). I had to insert the magic line in the VBA Editor.

Thanks!! Andreas
 

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