I now notice that Cesar wraps the entire ".Navigate(lcHTMLfile)" routine in a TRY/CATCH and then displays a "cannot load file" message to the user. Which probably explains why the error message is not so common. But it would be helpful to know why the navigate fails (antivirus, file copy timeout, navigate timeout, ...).
>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?