Copy HTML object to clipboard

D

Dean Allen

I've been struggling for hours to set up a macro that will copy an
active Word doc's HTML (which, as I understand it, always exists
beneath the surface) to the clipboard.

I would have thought this a simple two-line bit of VB, but no
combination I've tried has worked.

I'd be grateful for any help.

- Dean Allen
 
J

Jonathan West

Hi Dean

Selection.Copy copies the selected text to the clipboard

ActiveDocument.Range.Copy copies the whole of the main body of the document
to the clipboard.

The issue is not so much the underlying format of the Word document, but the
fact that the copied material exists on the clipboard in a variety of
formats, and you have to select which one will get pasted. This is not a
2-line VB concept.

If you go to http://www.mvps.org/vb/samples.htm and scroll down to the
ClipEx.zip sample, you will find code that may be helpful in what you are
wanting to achieve.
 

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