Hello,
sorry if this question has already been asked somewhere else, but I've been searching the Forum and googling for at least half a day and haven't come any closer to the answer I need.
We have a Customer who has Navision 3.70 Objekts running in a 6.00 Classic Client. The Customer wants to send out E-Mails with one attachment and no more than two adresses to send to. He also want's to look the mail over before acutally sending it, so Outlook has to open with everything already inserted (body, attachment, etc.).
So I used the Mail Codeunit (397), which has the MapiHandler. The Problem is, that Outllok doesn't open. No errormessage, nothing. When only running the function NewMessage the returnvariable is false.
What does this mean? Is Outllok 2007 not compatible with the old code of the function? Would it be possible to use a newer version of the codeunit? The NAVW16.00 Version doesn't use Navision Attain ApplicationHandler.Mapihandler but a bunch of 'NS Outlook Synchronization Handler' Automations, which seem to work just fine.
Thanks for any help in advance!
Ciao,
Lilithyan
0
Comments
You could write your own CodeUnit, or just replace functions in CodeUnit 397 with the versions from NAV2009.
I've done that, it works.
Replace these functions: OpenNewMessage, NewMessage, AddBodyLine, Send, GetErrorCode, GetErrorDesc
Add this one: GetMailGUIDFieldName
By the way, in your situation you don't get an error message automatically, but with the functions GetErrorCode and GetErrorDesc you would get
errorcode 429 ActiveX Component can't create object
By the way, the functions from Navision 2.60 would actually work! A bit different from NAV2009, but they do work.
One curieus thing. Function AddBodyLine did not seem to generate a CR/LF, so I added the CR/LF from the C/AL-code. Don't know why.
You can add an attachment, use multiple body lines, use multiple e-mail addresses.
I've tested this with Office 2010 and 2003.