48Highlander
Technical User
In my form I have a button that opens an HTML file and puts all of the HTML into a text box. It takes several seconds for the file to be opened. Before I call the function that calls the GetOpenFile api, I want to display the hourglass but it never displays.
I have the following code:
I have been fiddling around with DoEvents but I don't think I am using it correctly. What can I do to get the hourglass to display? Other than just displaying a tiny message on the status bar, is there anything else I can do to ensure the user patiently waits for the file to be loaded?
Bill J
I have the following code:
Code:
DoCmd.Hourglass True
DoCmd.Echo True, "Retrieving file, please wait...."
strFilter = "HTML (*.htm, *.html)" & vbNullChar & "*.htm;*.html" & _
vbNullChar & "All Files (*.*)" & vbNullChar & "*.*"
vFilePaths = fGetFile(e_FileMustExist + e_Explorer, , strFilter, , , , _
"Choose file for e-mail body ...", , 4096)
If Nz(vFilePaths, "") = "" Then
MsgBox "You did not select a file to import", vbExclamation, "Action cancelled"
GoTo Continue
End If
Me.txtHTMLpage = vFilePaths
Me.txtBody = ""
If oSMTP.ImportMailEx(Me.txtHTMLpage) <> 0 Then
MsgBox "Failed to add HTML page with error:" & vbCrLf & oSMTP.GetLastErrDescription(), vbExclamation, "Error"
bSMTPSuccess = False
Exit Sub
End If
Me.txtBody = oSMTP.BodyText
I have been fiddling around with DoEvents but I don't think I am using it correctly. What can I do to get the hourglass to display? Other than just displaying a tiny message on the status bar, is there anything else I can do to ensure the user patiently waits for the file to be loaded?
Bill J