?
Solved

Open attachement in mail if outlook is not open

Posted on 2010-08-26
3
Medium Priority
?
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
Viewers will learn the different options available in the Backstage view in Excel 2013.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Suggested Courses

764 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