scootgp200
Technical User
Hi,
Thanks to some great advice on a previous thread, using Excel I am able to open a word doc exctract each paragraph test for the applied style and write it into a line of html.
However I realise now that I need to go deeper into the document as normal paragraphs will possibly contain some text formatted as bold, italic or as a hyperlink. In those cases I would want to write the appropriate html tags around those words and in the case of a hyperlink extract the url and to make a working hyperlink in the html code.
Here is the code I now have to extract a paragraph
Can anyone tell me the code to read the style of each word in the paragraph.
Many Thanks
Bryan
Thanks to some great advice on a previous thread, using Excel I am able to open a word doc exctract each paragraph test for the applied style and write it into a line of html.
However I realise now that I need to go deeper into the document as normal paragraphs will possibly contain some text formatted as bold, italic or as a hyperlink. In those cases I would want to write the appropriate html tags around those words and in the case of a hyperlink extract the url and to make a working hyperlink in the html code.
Here is the code I now have to extract a paragraph
Code:
Select Case iParagraph.Style
Case "Heading 1"
' heading 1 stuff
Sheets("Sheet3").Range("a1000").End(xlUp).Offset(1, 0).Value = "<H1>" & iParagraph.Range.Text & "</H1>" Case "Heading 2"
' heading 2 stuff
Case "Heading 3"
' heading 3 stuff
Case "Normal"
' Normal stuff
Case Else
' if it is something else?
End Select
Can anyone tell me the code to read the style of each word in the paragraph.
Many Thanks
Bryan