Outlook 2013 , windows 8.1 Email (solved)

Outlook 2013 , windows 8.1 Email (solved)

Postby Richard Chidiak » Thu Jul 03, 2014 10:13 am

Hello

I have a problem sending email with Outlook (office 2013) and windows 8.1

If outlook is active , i get an error , no way to send the mail

if outlook is not active, the code will execute without a problem.

Does anyone know a workaround ?

Code: Select all  Expand view

TRY
  oOutlook = GetActiveObject( "Outlook.Application" )
//  MSGINFO("OUTLOOK EN EXECUTION")
 CATCH
  TRY
     oOutlook = CreateObject( "Outlook.Application" )
   CATCH
     msginfo("outlook can not be used")  // this is the message i get if outlook is active
   END
END

 
Last edited by Richard Chidiak on Fri Jul 04, 2014 1:52 pm, edited 1 time in total.
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Outlook 2013 , windows 8.1 Email

Postby hmpaquito » Thu Jul 03, 2014 12:09 pm

Richard,

More info about error:

Code: Select all  Expand view
TRY
  oOutlook = GetActiveObject( "Outlook.Application" )
//  MSGINFO("OUTLOOK EN EXECUTION")
 CATCH
  TRY
     oOutlook = CreateObject( "Outlook.Application" )
   CATCH oErr
     msginfo(oErr:Operation+ CRLF+ oErr:Description, "outlook can not be used")  // this is the message i get if outlook is active
   END
END
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Outlook 2013 , windows 8.1 Email

Postby Richard Chidiak » Thu Jul 03, 2014 1:17 pm

This is what i get

toleauto:new

0x80080005

Antonio , any idea about this ?
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Outlook 2013 , windows 8.1 Email

Postby hmpaquito » Thu Jul 03, 2014 2:27 pm

Richard,

From http://blogs.msdn.com/b/adioltean/archi ... 32519.aspx

Try:

Code: Select all  Expand view
FOR nIter:= 1 TO 3
   TRY
     oOutlook = GetActiveObject( "Outlook.Application" )
   //  MSGINFO("OUTLOOK EN EXECUTION")
    CATCH
     TRY
        oOutlook = CreateObject( "Outlook.Application" )
      CATCH oErr
//        msginfo(oErr:Operation+ CRLF+ oErr:Description, "outlook can not be used")  // this is the message i get if outlook is active
      END
   END
   IF oOutLook != NIL
       EXIT
   ENDIF
NEXT

IF oErr != nil
   msginfo(oErr:Operation+ CRLF+ oErr:Description, "outlook can not be used")  // this is the message i get if outlook is active
ENDIF
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Outlook 2013 , windows 8.1 Email

Postby driessen » Thu Jul 03, 2014 2:29 pm

This is the code I use :
Code: Select all  Expand view
TRY
   GetActiveObject("Outlook.Application")
CATCH
   ShellExecute(,"Open","Outlook",,,3)
END
TRY
   oOutLook   := TOleAuto():New("Outlook.Application")
   oNameSpace := oOutlook:GetNameSpace("MAPI")
   EmSend     := .T.
CATCH
   EmSend     := .F.
END

IF EmSend
... my mail is send
I noticed that Outlook has to be started to be used. That's why I use the "ShellExcute".

I use this code since Office 2000 until now. So it works very well with Outlook 2000, XP (2002), 2003, 2007, 2010 and 2013.

But you need to change the settings in the trust center of Outlook : the "Programmatic access" has to be put to "Automatically approve". If not, the mail will not be send. To change this setting, you have to open Outlook with administrator rights.. So go to the folder Office15, right click on OUTLOOK.EXE and select "Open as administrator".

Good luck.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Outlook 2013 , windows 8.1 Email Solved

Postby Richard Chidiak » Fri Jul 04, 2014 4:11 am

Problem fixed the security setting did the trick

Thanks

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests