Usage of InternetOpen from Outlook VB Add-in

P

paresh

Hi,

I have written Outlook Add-in which opens an our http link to do some
important work. It is working fine but has some inconsistencies and
performance issue with it. Though my code does cleanup, after few invocations
of that link from my Add-in toolbar button, Outlook gets non-responsive for
few seconds and then it comes back to normal but doesn't open http link.

Please refer my code give below and let me know if I am missing anything. I
really not sure why it has been happening like this. Any assistance would be
appreciated.

Sub GetUserInformation()
On Error GoTo Err_handler:
Dim hOpen As Long
Dim hConn As Long
Dim sUrl As String
Dim userId As Long
userId = 12345

sUrl = "https://getuserinfo.ky.com:14401/userinfo.cgi?q=" & userId

' create an internet connection, open link and do clean up
hOpen = InternetOpen("GetUserInformation", INTERNET_OPEN_TYPE_DIRECT,
vbNullString, vbNullString, 0)

hConn = InternetOpenUrl(hOpen, sUrl, vbNullString, ByVal 0&,
INTERNET_FLAG_RELOAD, ByVal 0&)

InternetCloseHandle hConn
InternetCloseHandle hOpen

Exit Sub
Err_handler:
MsgBox "Error in opening internet URL.", vbOKOnly, "GetUserInfo"

End Sub

Thanks.
 
E

Eric Legault [MVP - Outlook]

This wouldn't be an issue with Outlook in any way. Your dealing with factors
like web browsers and OS performance/configuration that's beyond Outlook's
control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top