CopyasPicture as lossing its format

F

fromvenky

Hi,

Can someone help me!, while I'm converting range text to picture its
losses its format?

Here what I'm doing

* Render formatted text to specified range by setting style to it,
ie "Heading 2"
Sample code
.InsertAfter "My Title" & vbCr
.Paragraphs.Last.Style = "Heading 2"

* Take range and convert it to picture
Sample code:
With r_rng
.CopyAsPicture
.Delete
.PasteSpecial Link:=False, Placement:=wdInLine,
DisplayAsIcon:=False, DataType:=wdPasteMetafilePicture
End With

code working fine, text successfully convert to picture but when i do
Edit Picture to see its style its showing....

Style : Normal Font: Arial : Font Size : 9

Where as expected style would be -- Style : Heading 2, Font : Arial,
Font Size : 10

can some tell me, where its getting wrong?
 
C

Cindy M -WordMVP-

See if commenting out the line that deletes that last paragraph (the
one you're copying) makes any difference. It's possible that the
feature requires the original to be intact in order to carry across the
formatting. If that's the case, then you can delete the range after
you've pasted.
Can someone help me!, while I'm converting range text to picture its
losses its format?

Here what I'm doing

* Render formatted text to specified range by setting style to it,
ie "Heading 2"
Sample code
.InsertAfter "My Title" & vbCr
.Paragraphs.Last.Style = "Heading 2"

* Take range and convert it to picture
Sample code:
With r_rng
.CopyAsPicture
.Delete
.PasteSpecial Link:=False, Placement:=wdInLine,
DisplayAsIcon:=False, DataType:=wdPasteMetafilePicture
End With

code working fine, text successfully convert to picture but when i do
Edit Picture to see its style its showing....

Style : Normal Font: Arial : Font Size : 9

Where as expected style would be -- Style : Heading 2, Font : Arial,
Font Size : 10

can some tell me, where its getting wrong?

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