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
L new outlook contacts searching Using Outlook 2
R Outlook 2010 Outlook 2010 migration question Using Outlook 2
W New Outlook PEOPLE blank Using Outlook 7
C New Outlook issues with Gmail, particularly labels/folders Using Outlook 4
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 7
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 1
V Gmail in Outlook Using Outlook 2
T Where has the Copilot icon gone in my Outlook desktop client? Using Outlook 6
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
A Missing Sent Emails in New Outlook Using Outlook 18
S Missing categories in Outlook calendar Using Outlook 10
P Windows 11 tries to open New Outlook when the user clicks on the mail icon on a news article Using Outlook 2
C I don't understand Outlook or Microsoft, anymore Using Outlook 12
P My Feedback to Microsoft and their response; also New Outlook roadmap Using Outlook 0
A New Outlook - Cannot drag IMAP emails to Task List in MyDay Using Outlook 1
L Android Outlook Doesn't Update PC Notification Changes Using Outlook 0
A How to open Excel file saved in Outlook folder? Outlook VBA and Custom Forms 4
D.Moore Outlook desktop client suggested searches question Using Outlook 22
Y Outlook 2016 (64-bit) Copy Local Cal. Events to Another Cal. with Modified Reminder time Using Outlook 2
T Outlook 2019 While connecting an IMAP account in "classic" Outlook 2024 I caused a massive duplication of emails on the server (death loop) Using Outlook 5
D Cannot logon to Outlook.com, or outlook on Mac, outlook not updating on ipad, iphone Using Outlook 1
J unable to get my new install of Outlook to display mailboxes in the single-line format. Using Outlook 1
D Legacy Microsoft Outlook for Mac Support will end in Oct 2025 Using Outlook 8
C Nasty Bug Lurking In Outlook For Years. The Trigger. Any Fix Or Workaround? Using Outlook 12

Similar threads

Back
Top