Usage of InternetOpen from Outlook VB Add-in

  • Thread starter Thread starter paresh
  • Start date Start date
Status
Not open for further replies.
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.
 
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.

Eric Legault - , MCDBA, MCTS (SharePoint programming, etc.)

"paresh" wrote:


> 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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
F Organizational Forms usage Exchange Server Administration 1
Diane Poremsky Exchange Server Usage, Reporting, and Analysis Tools Using Outlook 0
S Date/Time Field Natural Language Usage in VBA? Outlook VBA and Custom Forms 1
D Questions related to usage of webpage in outlook Using Outlook 1
M Outlook.exe 1.2Gb memory usage if running certain BCM reports BCM (Business Contact Manager) 8
T Usage Policy Notice pop-up Outlook VBA and Custom Forms 2
J column with actual email address in Outlook Classic Using Outlook 2
S Not receving all email since converting from Outlook 2007 to Outlook Classic Using Outlook 3
Rupert Dragwater Outlook 365 taking too long to synchronize each time email is being checked Using Outlook 11
Hornblower409 Outlook VBA Code Example - Unified inbox in Outlook Classic Outlook VBA and Custom Forms 5
J Need replacement for iTunes to locally (USB) sync. iPhone 17 to Classic Outlook 2024 Using Outlook 4
Thomas Fast Best way to manage incoming customer emails automatically in Outlook? Using Outlook 1
I Outlook 2024 Windows 11 Gmail - sudden log in problems Using Outlook 11
S Outlook Classic on 2024 Using Outlook 10
L Fresh Install of Windows 11, saved previous image, how to retrieve Outlook Contacts Using Outlook 10
C Can't Use Custom Contact form in Outlook Classic since early January 2026 Outlook VBA and Custom Forms 7
e_a_g_l_e_p_i Need help updating email in Outlook 2021 Using Outlook 10
V Outlook spam filter misbehaving Using Outlook 9
L what are the downsides of running both classic and new outlook on same win 11 pc? Using Outlook 2
P Preventing permanent deletions in Outlook on the Web Using Outlook 0
L any trick to embedding images in new outlook and outlook on the web contacts? Using Outlook 4
L new outlook contacts searching Using Outlook 5
R Outlook 2010 Outlook 2010 migration question Using Outlook 2
W New Outlook PEOPLE blank Using Outlook 6
C New Outlook issues with Gmail, particularly labels/folders Using Outlook 3
E What is the next workaround for macro in New Outlook 1.2025.1111.100 Outlook VBA and Custom Forms 3
E Need to digitally sign macro but VBA\Outlook crash Outlook VBA and Custom Forms 4
P Outlook 2003 no longer opens "without" Folder List Showing in Navigation Pane Using Outlook 2
Hornblower409 Outlook 2010 - Never ending update Using Outlook 0
V Outlook created new profile? Using Outlook 1
J Outlook inbox question Using Outlook 4
T How to Add AT&T Contacts to Outlook 365 Using Outlook 5
F Outlook 2021 outlook on iPhone Using Outlook 1
F Outlook 2021 Outlook on iPhone asks for password Using Outlook 0
P ics calendar entries suddenly open up new Outlook Using Outlook 3
P Outlook "forgets" password until system rebooted Using Outlook 2
N Why does Outlook keeping adding to the email address I have in my notes portion of a contact? Using Outlook 2
M Anyone integrated AI website builders with Outlook for automated client communications? Using Outlook 4
V Gmail in Outlook Using Outlook 2
T Where has the Copilot icon gone in my Outlook desktop client? Using Outlook 10
P New way by Microsoft to get people to use the new Outlook Using Outlook 4
C How to keep emails in account in Outlook after closing the IMAP account Using Outlook 1
cymumtaz IMAP calendars in New Outlook Using Outlook 5
T Constantly Have To Log In To Outlook On The Web Using Outlook.com accounts in Outlook 2
T Cannot Find Outlook Noted On Android Using Outlook 4
O Outlook 2024 not showing that messages are replied to or forwarded Using Outlook 3
C Outlook 365 send/receive takes FOREVER - as in 40 minutes Using Outlook 7
I Outlook 2024 LTSC syncing with iCloud calendar - can only make appt. in iCloud Using Outlook 2
Kika Melo Outlook ribbon customisations do not 'stick' Using Outlook 12
J IMAP Folders Confusion in Windows Classic Outlook Using Outlook 1

Similar threads

Back
Top