Converting a Selection/Range Object to HTML 
Author Message
 Converting a Selection/Range Object to HTML

Does anyone know of a way of converting a Selection (or Range) object
to a usable HTML string. I need to retain (as closely as possible) the
original formatting that the selection has.

I'm stumped...

Thanks

John Armstrong-Prior



Sun, 28 Aug 2005 01:19:18 GMT  
 Converting a Selection/Range Object to HTML
By switching to the Microsoft Script Editor
From the main menu: Tools | Macro | Microsoft Script Editor

Note:
1) The entire document is translated into HTML code

2) if you don't see this submenu-item, you will need to
install this feature from yr MS Office installation CD.

Krgrds,
Perry



Quote:
> Does anyone know of a way of converting a Selection (or Range) object
> to a usable HTML string. I need to retain (as closely as possible) the
> original formatting that the selection has.

> I'm stumped...

> Thanks

> John Armstrong-Prior



Sun, 28 Aug 2005 01:51:47 GMT  
 Converting a Selection/Range Object to HTML
Try using the HTMLProject object of the Word.Document

something like

objDoc.HTMLProject.Open msoHTMLProjectOpenTextView
Set objHTML = objDoc.HTMLProject

objDoc.Range.Text = objHTML.HTMLProjectItems(1).Text

This should take the rich text in the objDoc document, open an HTMLProject
with xml converted from the rich text, and put that xml back into the word
document, for you to parse for the relevant html.  Might be what you need.

minime2323


Quote:
> Does anyone know of a way of converting a Selection (or Range) object
> to a usable HTML string. I need to retain (as closely as possible) the
> original formatting that the selection has.

> I'm stumped...

> Thanks

> John Armstrong-Prior



Sun, 28 Aug 2005 05:01:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Range object, Selection object

2. Using Range object instead of Selection

3. Working with Range / Selection Objects

4. Word 97/XP Range vs Selection Object

5. Word Object Model : Find a position within a Range or Selection

6. Crystal Reports 8.5 date range parameter field - record selection that includes null date range

7. Converting Doc Form to HTML Loses Drop-Down (ComboBox) Selection Text

8. HTML of Range object

9. Capturing the selection from HTML selection lists

10. VBA EXCEL97: How to get the range from a chart into a range object

11. Generate Range selection box in Excel from Access

12. Excel Range Selection

 

 
Powered by phpBB® Forum Software