Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 2 Oct 2008 23:41:01 -0700,    group: microsoft.public.word.vba.general        back       


MS word 2007 PasteSpecial   
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.
date: Thu, 2 Oct 2008 23:41:01 -0700   author:   ddm

Re: MS word 2007 PasteSpecial   
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 :-)
date: Sun, 05 Oct 2008 14:04:23 +0200   author:   Cindy M.

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us