Object:  Application.ActiveDocument.body.innerHTML

This procedure will get the innerHTML of the ActiveDocument.

The OuterHTML included the <body> start tag, the </body> end tag and everything between these two tags.

The only difference between InnerHTML and OuterHTML is that the OuterHTML will include the <body> and </body> tags.   The innerHTML will not include these tags, but will include all of the InnerHTML.

Function GetOuterHTML() As String
   'Tested 20090208
   On Error GoTo errHandler1
   GetOuterHTML = Application.ActiveDocument. _
   body.outerHTML
   Exit Function
errHandler1:
   'Notify user of failure.
   MsgBox "GetOuterHTML has failed", _
   vbCritical, "Function Failure"
End Function			

 

Valid XHTML 1.0 Transitional        Valid CSS!