Solved

Open attachement in mail if outlook is not open

Posted on 2010-08-26
3
284 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
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: …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 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