PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Delete
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Delete
![]() |
Delete |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I am a newbie to Outlook VBA so please have patience.
What I need to create is code that I can attach to a button to delete emails from another users folder and then to permanently delete them from the deleted items. Anything would be helpful. Thanks in advance |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Use the GetDefaultSharedFolder method to return another user's mailbox, and
loop through the MAPIFolder object's Items collection to retrieve individual MailItem objects and use the Delete method. The FolderType parameter for GetDefaultSharedFolder will allow you to return the Inbox or Deleted Items folder, amongst others. You'd have to provide additional coding logic to find the message you just deleted in the Deleted Items folder by either looping through Items and comparing Subject property values, or use the Restrict method, and then delete that message as well. Or you could use CDO; the Message.Delete method allows you to bypass sending the message to Deleted Items. For more resources for programming with Outlook, start here: Visual Basic and VBA Coding in Microsoft Outlook: http://www.outlookcode.com/d/vb.htm -- Eric Legault - B.A, MCP, MCSD, Outlook MVP -------------------------------------------------- {Private e-mails ignored} Job: http://www.imaginets.com Blog: http://blogs.officezealot.com/legault/ "Rizza" wrote: > I am a newbie to Outlook VBA so please have patience. > What I need to create is code that I can attach to a button to delete emails > from another users folder and then to permanently delete them from the > deleted items. > Anything would be helpful. > Thanks in advance > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

