Unflag Inbox and Flag Inbox with Orange Category After Item is send

Status
Not open for further replies.

alvinoo

Member
Outlook version
Outlook 2019 64-bit
Email Account
Office 365 Exchange
Sub ReplyMSG() Dim olItem As Outlook.MailItem Dim olReply As MailItem ' Reply For Each olItem In Application.ActiveExplorer.Selection Set olReply = olItem.ReplyAll CopyAttachments olItem, olReply olReply.HTMLBody = "Hi,please follow up" olReply.Display 'olReply.Send Next olItem End Sub

Hi there,

How do I flag the send item with a category and items with a flag,
and unflag the inbox item.
IF and only IF the item is sent?
 
and items with a flag,
and unflag the inbox item.
IF and only IF the item is sent?

Do you want to flag the sent item or the inbox items with a flag?


This will flag the selected item,. add a category and adds the quoted message, preserving the HTML format to the outgoing message.


Code:
Sub ReplyMSG()
Dim olItem As Outlook.MailItem
Dim olReply As MailItem ' Reply
For Each olItem In Application.ActiveExplorer.Selection

With olItem
' due this week flag
    .MarkAsTask olMarkThisWeek
' sets a specific due date
    .TaskDueDate = Now + 3
    .FlagRequest = "Call " & .SenderName
    .ReminderSet = True
    .ReminderTime = Now + 2
    .Save
End With


Set olReply = olItem.ReplyAll
CopyAttachments olItem, olReply

With olReply
.Categories = "Follow up"
.HTMLBody = "Hi,please follow up" & vbCrLf & olReply.HTMLBody
.Display
'.Send
End With
Next olItem
End Sub
 
Hi there,

I want to flag the sent item.

So i just change the code to the following right?

With olReply
' due this week flag
.MarkAsTask olMarkThisWeek
' sets a specific due date
.TaskDueDate = Now + 3
.FlagRequest = "Call " & .SenderName
.ReminderSet = True
.ReminderTime = Now + 2
.Save
End With
 
Yeah, adjust the values as needed. Depending on your configuration, it may set a flag in the recipients mailbox,. to avoid that, you need to use a macro that watches the sent folder and flags messages in that category.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
P unflag sync'd emails Using Outlook 3
F Outlook 365 Group INBOX by date but not by date and time Using Outlook 1
T Outlook 2010 Sub accounts not showing new emails in Inbox Using Outlook 4
F Color code certain INBOX emails Using Outlook 2
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
J Outlook 365 Forward Email Subject to my inbox when new email arrive in shared inbox Using Outlook 0
P "Item could not be moved" message occurs frequently for IMAP inbox, Office 365 Using Outlook 0
D Gmail mail is being delivered to a different email inbox in Outlook App 2021 Using Outlook 2
S Format Inbox Using Outlook 0
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
P Emails assigned with a certain category (within a shared inbox) to be copied to a specific folder. Outlook VBA and Custom Forms 2
O Moving "tasks" to inbox in Outlook 2016 Using Outlook 1
A Imap account not auto syncing inbox at startup Using Outlook 0
S Outlook 2016 dont delete inbox item Using Outlook 0
F Jump to Inbox folder when click on Favorite Using Outlook 8
R Moved 6 months worth (approx 1500 emails) lost from moving from TPG inbox to Icloud inbox (folders) Using Outlook 3
S Problem Checking the available stores in my Inbox (Outlook VBA) Outlook VBA and Custom Forms 0
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
A Inbox didn't got read Outlook VBA and Custom Forms 0
glnz O365 - How to combine the Inboxes for four email accounts into a single Inbox Using Outlook 7
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
G Inbox shows old email Using Outlook 3
C Configuring Inbox columns Using Outlook 2
D Inbox column color coding Using Outlook 2
R Outlook 2010 How do you export 2 email Accounts' 2010 Inbox Files to new computer (2019)? Using Outlook 0
J Collaborative Inbox Using Outlook 1
M Missing emails in Inbox, but are present in webmail Using Outlook 0
R List folders in a combo box + select folder + move emails from inbox to that folder + reply to that email Outlook VBA and Custom Forms 1
H Upon opening Outlook, make my popmail inbox open instead of outlook.com inbox Using Outlook 1
P Outlook Mobile App Doesn't Refresh Inbox Using Outlook 0
H In outlook 365 POP mail Inbox, email takes a long time or never arrives. Using Outlook 1
K No emails in inbox Using Outlook.com accounts in Outlook 1
D Unopened message in inbox deleted and not in deleted items Using Outlook 3
R Exporting recovered Deleted Items outside the Inbox Using Outlook 1
N Focussed Inbox Rules Failing Using Outlook 5
M Inbox not showing to deliver new email to this account Using Outlook 3
mctabish Setting "Reply To" based on inbox Outlook VBA and Custom Forms 2
T Inbox Sub-Folder - Web Using Outlook 1
P Two main Outlook gripes: Voting buttons not working externally nor Focused Inbox Using Outlook 1
P when i move inbox mails to another folder in outlook the mail disappears Using Outlook 1
B VBA Macro for assigning multiple Categories to an email in my Inbox Outlook VBA and Custom Forms 1
N Syncing my inbox not working for certain types of mail Using Outlook 9
D How to handle filing of emails from an Inbox Subfolder to a specific Public folder Using Outlook 1
E Outlook 2016 Inbox search bug Using Outlook 1
O Having rules run on old mails noved to inbox Outlook VBA and Custom Forms 8
K Outlook 2010 duplicate download emails 1 inbox 1 PST no updates Using Outlook 3
LolaArrabal My huge inbox folder Using Outlook 2
M VBA macro for Inbox's attachments search Outlook VBA and Custom Forms 0
M Emails being sent to Inbox and IPM_Subtree Using Outlook.com accounts in Outlook 4

Similar threads

Back
Top