Importing html code using HTMLProject object [modified]
-
Hello I have extracted the html code from a web table embedded in a Word document and stored it in a variable string as shown below. The Word document is saved as an html page in Word.
Dim html_string as String
html_string = ActiveDocument.HTMLProject.HTMLProjectItems(1).Text
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, count:=1
Selection.TypeText Text:=html_string '''LINE 5 is the problem lineIt works very well when I test the script on Word documents with small embedded html tables with few rows and columns but not everything gets stored for large tables beyond a certain number of rows and columns. The string gets truncated after some point. The truncation seems to take place when I execute line 5 above (Selection.TypeText Text:html_string). The "html_string" variable itself retains all of the html code when I throw it's output to the screen so I know for a fact something is happening when I place the contents into the active Word document using the Selection.TypeText method. Is there a character size limit when using the Selection.TypeText method? If so, is there a way around this? Thanks :cool: Harry Wishes
modified on Thursday, July 2, 2009 9:24 AM