mdaiber614
Programmer
I am currently developing a macro for attachmate extra!. First the report is run in attachmate using send keys, then the macro waits for an email to show up in Outlook saying that the report is complete, and copies the URL from Outlook. All of this is complete and working. I need to develop code to copy all of the text in the browser and paste into a word document. I have tried the following code, and it works for most reports; however, for one longer report, it causes the macro editor to crash. Thinking about maybe using parsing, but I am not quite sure how to get that to work here. Any help would be greatly appreciated!!
Dim HTML As Object
Dim URL As String
Dim MSWORD As Object
Dim objDOC As Object
Dim ReportText As String
Set HTML = CreateObject("MSXML2.XMLHTTP60")
URL = "Set MSWORD = CreateObject("Word.Applications.8")
Set objDOC = MSWORD.Documents.Add
HTML.Open "GET", URL, False
HTML.Send
ReportText = HTML.responseText
objDOC.Content.InsertAfter ReportText
Dim HTML As Object
Dim URL As String
Dim MSWORD As Object
Dim objDOC As Object
Dim ReportText As String
Set HTML = CreateObject("MSXML2.XMLHTTP60")
URL = "Set MSWORD = CreateObject("Word.Applications.8")
Set objDOC = MSWORD.Documents.Add
HTML.Open "GET", URL, False
HTML.Send
ReportText = HTML.responseText
objDOC.Content.InsertAfter ReportText