Solved

Open attachement in mail if outlook is not open

Posted on 2010-08-26
3
279 Views
Last Modified: 2012-06-27
Hello experts,
I have a problem with my Dynamics NAV program. I use this to send an email using MAPI. For this I use the outlook libraries, and this works fine. However, I have one issue: if outlook is not open when I send the mail, I cannot open the attachments that I added to the mail. If outlook is open, I can open the attachments.

This is my code:
CREATE(autOutlookAPP, TRUE, TRUE);
autOutlookNamespace := autOutlookAPP.GetNamespace('MAPI');
autOutlookNamespace.Logon('','',TRUE,FALSE);

autOutlookItem := autOutlookAPP.CreateItem(0);
autOutlookItem.Subject( ... );

autOutlookAtts := autOutlookItem.Attachments;
autOutlookAtts.Add( '...' );

autOutlookItem.Display;

Open in new window


I suspect it has something to do with the logon (permissions), but I'm not sure. Do you have any ideas ?

Kind regards,
Andy

0
Comment
Question by:ACAE
  • 2
3 Comments
 
LVL 10

Expert Comment

by:MaduKp
ID: 33540223
Not sure about this. But will this helps you?
http://www.fontstuff.com/outlook/oltut01.htm

0
 

Accepted Solution

by:
ACAE earned 0 total points
ID: 33541234
Hi, I'm sorry this doesn't help me. I don't use macro's in outlook itself, I use outlook (in the background) to send a mail from another application.

Andy
0
 

Author Comment

by:ACAE
ID: 33565685
Hello,
Is there another expert with a possible solution ?
Andy
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Outlook Free & Paid Tools
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now