1. William Beale
  2. PowerBuilder
  3. Sunday, 16 July 2023 03:59 AM UTC

Hi,

I have OLE code to connect to MS Outlook but since upgrading Outlook to the current version ( 1.2023.630.100) the code no longer works.  This is the code that worked before the upgrade:

oleApplication = CREATE n_OLEObject
// Connect to Outlook. 
li_rc = oleApplication.ConnectToNewObject("Outlook.Application")
IF li_rc <> 0 THEN
          MessageBox("Error connecting to Outlook", &
         + "Check if Outlook is Running - ~r" + oleApplication.of_ConnectError(li_rc), StopSign!)
        RETURN -1
END IF

I suspect "Outlook.Application" may no longer be relevant but can't find anything on the web.

I'm using PB 2019 R3.

Advice would be appreciated.

 

Bill Beale

 

 

 

 

Who is viewing this page
Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Sunday, 16 July 2023 08:22 AM UTC
  2. PowerBuilder
  3. # Permalink

Adding: make sure you have a profile set as the default for outlook

Your ConnectToNewObject should still work.

We use Outlook 365 (latest version) both 32 and 64 bit Office and with PB 32 bit executables (2019 R3). It works perfectly fine. Like Chris said, maybe you should re-install Office.

regards

Comment
  1. Mark Goldsmith
  2. Monday, 17 July 2023 16:07 PM UTC
@Miguel...by the looks of this list (https://support.microsoft.com/en-us/office/getting-started-with-the-new-outlook-for-windows-656bb8d9-5a60-49b2-a98b-ba7822bc7627) OLE is not a supported feature but who knows at this point whether that will change.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 17 July 2023 16:58 PM UTC
Hi Mark

I've been doing some Google and it doesn't look like Office365 is going to go away anytime soon. Basically the "New Outlook" (silly naming), is simply a glorified version of the current Outlook Web Mail. It doesn't make sense of them advertising it in Outlook 365, but they just want loads of beta testers. They talk a lot about the possibility of creating Plugins using JS, but totally ignore the Deverlopers using C# VB .net, Powerbuilder etc. If they would totally replace Outlook365 with this pile of .... they would get a LOT of problems with developers and companies.

(not that they care ...)

regards.
  1. Helpful
  1. Mark Goldsmith
  2. Monday, 17 July 2023 20:52 PM UTC
Agreed!
  1. Helpful
There are no comments made yet.
William Beale Accepted Answer Pending Moderation
  1. Monday, 17 July 2023 04:10 AM UTC
  2. PowerBuilder
  3. # 1

Thanks everyone.  It seems the problem was with the new installation as the OS could not connect when logging on to the computer again.  Issue resolved.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 16 July 2023 04:17 AM UTC
  2. PowerBuilder
  3. # 2

Hi Bill;

 FYI: https://learn.microsoft.com/en-us/office/vba/outlook/concepts/getting-started/ole-programmatic-identifiers-outlook

Sounds like the outlook product may not be fully installed.

  Also, make sure that the correct bitness if the Outlook client is installed that matches your PB App / IDE. Otherwise, your Apps won't see it.

Regards ... Chris 

Comment
  1. Miguel Leeuwe
  2. Sunday, 16 July 2023 08:24 AM UTC
OLE will work for both 32 and 64 bit. No matter if your PB app is 64 or 32 bits.
  1. Helpful 2
  1. Chris Pollach @Appeon
  2. Sunday, 16 July 2023 13:21 PM UTC
I think you're correct Miguel. I was thinking of MAPI <my bad>.

Bill's OLE issue though could also be missing or corrupt Outlook O/S registry entries too.
  1. Helpful 1
  1. Miguel Leeuwe
  2. Sunday, 16 July 2023 13:44 PM UTC
Yes, using MAPI it does make a difference. Bill's problem could have several reasons. Sometimes it's even as simple as having to reboot the PC.
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.