Excel to Word using HTML

O

Ottar Holstad

Hi, if I manually copy something from Excel to Word using Ctrl+C/Ctrl+V, the
result in Word looks good. If I do the same in code, using [...]
Selection.Paste, the result in Word looks less good. I have noticed that if
I, when copying manually, use paste special and Rich Text Format, the result
in Word looks the same as when using [...] Selection.Paste in code. If I use
paste special and HTML when copying manually, it looks good. So, I figured
that I should try to use [...] Selection.PasteSpecial(....) in code.
However, when doing so I just get the message "The specified data type is
unavailable". How come? Is Word/Excel doing something special with the
clipboard? If so, could I do that too?
 
C

Cindy M.

Hi Ottar,
if I manually copy something from Excel to Word using Ctrl+C/Ctrl+V, the
result in Word looks good. If I do the same in code, using [...]
Selection.Paste, the result in Word looks less good. I have noticed that if
I, when copying manually, use paste special and Rich Text Format, the result
in Word looks the same as when using [...] Selection.Paste in code. If I use
paste special and HTML when copying manually, it looks good. So, I figured
that I should try to use [...] Selection.PasteSpecial(....) in code.
However, when doing so I just get the message "The specified data type is
unavailable". How come? Is Word/Excel doing something special with the
clipboard? If so, could I do that too?
Please show us the code you're using that's not giving the desired result?

And have you tried recording a macro when using PasteSpecial + HTML format to
see what Word itself is using?

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