Hello guys,
There is a much easier solution to get arround this problem with Outlook.
You can download it free at : www.mapilab.com/outlook/security
It works with all Outlook versions.
Regards,
Problem with OLE and Outlook 2007
Re: Problem with OLE and Outlook 2007
Hi, anyone have a solution about this error?
I have try:
oOutLook := CreateObject("Outlook.Application")
oNameSpace := oOutlook:GetNameSpace("MAPI")
oMail := oOutLook:CreateItem(0)
oMail:Subject := "test"
oMail:Body := "test"
oMail:Recipients:Add("myemail")
oMail:CC := ""
oMail:BCC := ""
oMail:Send()
and:
oOutLook := CreateObject("Outlook.Application")
oNameSpace := oOutlook:GetNameSpace("MAPI")
oMail := oOutLook:CreateItem(0)
oMail:Subject := "test"
oMail:Body := "test"
oMail:To := "myemail"
oMail:CC := ""
oMail:BCC := ""
oMail:Send()
and both gives the error: Error description: Error Outlook.Application:CREATEITEM/0 S_OK: RECIPIENTS
If i open outlook 2007 first thats ok. Any idea? Thanks in advance.
Wanderson
I have try:
oOutLook := CreateObject("Outlook.Application")
oNameSpace := oOutlook:GetNameSpace("MAPI")
oMail := oOutLook:CreateItem(0)
oMail:Subject := "test"
oMail:Body := "test"
oMail:Recipients:Add("myemail")
oMail:CC := ""
oMail:BCC := ""
oMail:Send()
and:
oOutLook := CreateObject("Outlook.Application")
oNameSpace := oOutlook:GetNameSpace("MAPI")
oMail := oOutLook:CreateItem(0)
oMail:Subject := "test"
oMail:Body := "test"
oMail:To := "myemail"
oMail:CC := ""
oMail:BCC := ""
oMail:Send()
and both gives the error: Error description: Error Outlook.Application:CREATEITEM/0 S_OK: RECIPIENTS
If i open outlook 2007 first thats ok. Any idea? Thanks in advance.
Wanderson
Re: Problem with OLE and Outlook 2007
Hello,
I use exactly the same code without having any problems.
But I noticed the you useMaybe you should try a real e-mail address with a @ in it.
Good luck.
I use exactly the same code without having any problems.
But I noticed the you use
Code: Select all | Expand
oMail:Recipients:Add("myemail")
Good luck.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Re: Problem with OLE and Outlook 2007
driessen wrote:Hello,
I use exactly the same code without having any problems.
But I noticed the you useMaybe you should try a real e-mail address with a @ in it.Code: Select all | Expand
oMail:Recipients:Add("myemail")
Good luck.
Hello driessen, "myemail" its just a exemple i have using a real email in this case, but if outlook2007 is not open show the error reported, what your fwh version?
Thanks in advance.
Re: Problem with OLE and Outlook 2007
Hello,
Sorry but I think I didn't understand your question very well.
This is the code I use to make a connection to Outlook to avoid the error you mentioned :Hope this can help you. It runs fine in my application.
Good luck.
Sorry but I think I didn't understand your question very well.
This is the code I use to make a connection to Outlook to avoid the error you mentioned :
Code: Select all | Expand
LOCAL cTasks
LOCAL OutlFound := .F.
cTasks := GetTasks()
FOR i=1 TO LEN(cTasks)
IF AT("OUTLOOK",UPPER(cTasks[i])) <> 0
OutlFound := .T.
i := LEN(cTasks)
ENDIF
NEXT
IF !OutlFound ; ShellExecute(,"Open","Outlook",,,3) ; ENDIF
TRY
oOutLook := CreateObject("Outlook.Application")
oNameSpace := oOutlook:GetNameSpace("MAPI")
EmSend := .T.
CATCH
TRY
oOutLook := CreateObject("Outlook.Application")
oNameSpace := oOutlook:GetNameSpace("MAPI")
EmSend := .T.
CATCH
EmSend := .F.
END
END
IF EmSend
// Your source to send your mail
ENDIF
Good luck.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773