Results 1 to 3 of 3
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Linked Outlook emails

    Within Access 2010, I have a table that is linked to Outlook 2010 emails. After processing this email within Access, the following code moves the email from 1 folder to another folder in Outlook.


    'Move emails that were just processed into different folder

    Dim appOutlook As Outlook.Application
    Dim nms As Outlook.NameSpace
    Dim fld As Outlook.MAPIFolder
    Dim fld2 As Outlook.MAPIFolder

    Set appOutlook = GetObject(, "Outlook.Application")
    Set nms = appOutlook.GetNamespace("MAPI")
    Set fld = nms.Folders.Item("Dispatch - SafeCarAutoTransport.com").Folders.Item("Inbox").F olders.Item("New Web Quote")
    Set fld2 = nms.Folders.Item("Dispatch - SafeCarAutoTransport.com").Folders.Item("Inbox").F olders.Item("Processed Quote")


    'Determine if records exist within fld, and then move them into fld2
    While fld.Items.Count > 0

    fld.Items(1).Move fld2

    Wend

    My question is this, these emails are marked as unread. How do I mark the emails as read once they are moved to the new folder?

    Thank you in advance!!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You want to mark the item in folder 2 as read?

    Need to use the Unread property of each item in the folder. So think need to refer to each mail item as an object.

    Dim mailItem As Object
    For each mailItem in fld2
    mailItem.Unread = False
    Next
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks!! I used part of your code. I pasted the line "mailItem.Unread = False" in my code before the line that moves the email from 1 folder to the other folder.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Assigning Outlook task from shared Outlook mailbox
    By Remster in forum Programming
    Replies: 2
    Last Post: 11-16-2011, 04:38 AM
  2. Using Access to move Outlook Emails
    By crowegreg in forum Access
    Replies: 1
    Last Post: 09-28-2011, 02:25 PM
  3. How to Import Outlook emails with embedded images
    By imav in forum Import/Export Data
    Replies: 1
    Last Post: 08-06-2011, 09:53 AM
  4. Access 2007 & Outlook Linked Tables
    By RobTop in forum Access
    Replies: 0
    Last Post: 03-08-2011, 08:24 AM
  5. Linked table from outlook missing columns
    By nehamd4 in forum Access
    Replies: 0
    Last Post: 07-21-2010, 12:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums