MS word 2007 PasteSpecial

D

ddm

hi,

i has a application that call pastespecial function in MS word 2007, it give
me black color window meta file. Basically, this application will open a word
doc which has a small drawing file inside, and then use the pastespecial it
to another opened word document. It give me the black color picture.

When the document is opened, i try manually add the Home->
Clipboard->Paste-> PAsteSpecial and select the window Metafile, i able to add
to the opened word document and after that able see the actual picture.

the code that doing this,

xxx.Selection.PasteSpecial Placement:=wdlnLine,
DataType:=wdPasteMetaFilePicture


Hope this help.
 
C

Cindy M.

Hi =?Utf-8?B?ZGRt?=,
i has a application that call pastespecial function in MS word 2007, it give
me black color window meta file. Basically, this application will open a word
doc which has a small drawing file inside, and then use the pastespecial it
to another opened word document. It give me the black color picture.

When the document is opened, i try manually add the Home->
Clipboard->Paste-> PAsteSpecial and select the window Metafile, i able to add
to the opened word document and after that able see the actual picture.

the code that doing this,

xxx.Selection.PasteSpecial Placement:=wdlnLine,
DataType:=wdPasteMetaFilePicture
If you do this "by hand" (as an end-user) do you see the result you want to
have? Or does this also result in a black picture?

If it does give you the correct result, try recording the action in a Macro, in
Word. Then compare the PasteSpecial arguments in the macro to the code you have.

If the arguments' values match, I have a question for you: Are you closing the
first document (with the picture) before you paste in the second document?

Note: you use wdInLine in the code snippet you give us. If the original picture
is also "in line" you could use the Range.FormattedText property to transfer the
picture - no need to use the Clipboard. That might give you better fidelity.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

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

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