troubleshooting Question

Word Merge - Manipulate Outlook Emails (Add a Reminde to follow-up)

Avatar of rogerdjr
rogerdjrFlag for United States of America asked on
Microsoft OfficeOutlookMicrosoft Word
3 Comments1 Solution646 ViewsLast Modified:
I am using the following code to add attachments, and make to changes created by Word Mail merge.

Everything seems to work pretty good but the flag and reminder updates:

               .FlagDueBy = CStr(DateAdd("d", 10, Int(Now()))) & " 08:00"
               .FlagIcon = olBlueFlagIcon
               .Categories = "0_Owners Representative, _0Priority Follow-up,  Agriculture Client"

What I want to do is add a flag for myself with a reminder to follow-up on the email in a predeterminded number of days.

I tried to find more information on the flag and reminder propertieas and how they work, but had no success

Any help would be appreciated.

Thanks

Roger
-----------------------------------------------------------------------

Sub a_OutlookOutboxAddAttachnmentsToEmails()
    Dim olkApp As Object
    Dim mai As Object
    Dim acct As Long
    Dim fldr As Object
    Dim OfflineChk As Boolean
    Dim UserSelectOfflineYN As Boolean
       
    Dim ctl As Office.CommandBarControl
       
       
        acct = getAccount
        If acct = 0 Then acct = 1
        Set olkApp = CreateObject("outlook.application")
       
    Set fldr = olkApp.Session.PickFolder

    If fldr Is Nothing Then Exit Sub
      For Each mai In fldr.Items
          If mai.Class = 43 Then
              With mai
                .Importance = 2
                .ReadReceiptRequested = True
                .OriginatorDeliveryReportRequested = True
                .Attachments.Add "r:\icm\ICM Owner's Representative Services.pdf"
                .Attachments.Add "r:\icm\ICM Services Brochure - Email Version.pdf"
                .SendUsingAccount = olkApp.Session.Accounts.Item(acct)
                .SentOnBehalfOfName = olkApp.Session.Accounts.Item(acct)
                '.CC = "nmonicalal@aol.com; btolland@tbdconsultants.com; cwallender@sgh.com"
                .BCC = "kelleyc@wrdarch.com"
                .FlagDueBy = CStr(DateAdd("d", 10, Int(Now()))) & " 08:00" ' today + 10 days @ 8:00 AM
                .FlagIcon = olBlueFlagIcon
                .Categories = "0_Owners Representative, _0Priority Follow-up,  Agriculture Client"
                '.Display
                .Save
                '.Send
            End With
        End If
     
    Next

End Sub

Function getAccount() As Long
Dim olkApp As Object
Dim i As Long
   
    Set olkApp = CreateObject("outlook.application")
    For i = 1 To olkApp.Session.Accounts.Count
        If (MsgBox("Use Account " & olkApp.Session.Accounts.Item(i).SmtpAddress, vbYesNo)) = vbYes Then 'olkApp.Session.accounts.item(i)
            getAccount = i
            Exit For
        End If
    Next

End Function
ASKER CERTIFIED SOLUTION
Lambert Heenan
The Man

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros