I had that single TYPE command and tried to add a TYPE check on the "this.document.body" line as well. Still errored. I had the following code in the DownloadComplete method.
IF TYPE("this.document") = "O"
IF TYPE("this.document.body") = "O"
This.Document.Body.contentEditable = .T.
ENDIF
ENDIF
>Try to check for
>
>TYPE("This.Document") = "O"
>
>
>>I am using Cesar Chalom's email form & classes contained in his FoxyPreviewer code. Specifically, the class is "pr_htmledit." Periodically it will error with the message: "Member DOCUMENT does not evaluate to an object." The error appears to be occuring at the cie.DownloadComplete method's command...
>>
>>
This.Document.Body.contentEditable = .T.
>>
>>I have tried to wrap that command in TYPE commands attempting to issue it only when "this.document.body" is an object type, but no joy.
>>
>>On workstations, it appears to occur more frequently... as though its a timing issue with the instantiation of the IE control or the Navigate command.
>>
>>The original INIT code of PR_HTMLEDIT.CIE looks like...
>>
>>
>>* Navigate to a blank page
>>
>>*This.Navigate2("About:Blank")
>>* Prevent an OLE error, and wait until the object
>>* gets the blank page open before showing or accessing
>>
>>LOCAL lnLoadTimeout
>>lnLoadTimeout = 6
>>WITH This.OBJECT
>> .Navigate("about:blank")
>> * Wait for load completion
>> lnStartSeconds = SECONDS()
>> DO WHILE .ReadyState <> 4 ;
>> AND (SECONDS()-lnStartSeconds <= lnLoadTimeout )
>> DOEVENTS
>> ENDDO
>>ENDWITH
>>
>>
>>Because i dont see an explicit call to DownloadComplete in the class, I assume that the method is called by the .Navigate method natively.
>>
>>A template html email file/msg is loaded during the form's INIT using something like the code below, but the reported error does not occur here.
>>
>>
>>IF FILE("&lcHTMLfile")
>> WITH Thisform.Chtmleditor1.oIE
>> .Navigate("&lcHTMLFile")
>> DO WHILE .ReadyState != 4
>> DOEVENTS
>> ENDDO
>> .Document.Body.contentEditable = .T.
>> ENDWITH
>>ENDIF
>>
>>
>>The class's DownloadComplete method which issues the problematic "document.body.contentEditable" command appears to be redundant based on my situation, but i'm wondering if i am moving the problem from one method to another. Plus its hard to produce, but consistant enough to cause headaches.
>>
>>Any ideas?