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

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?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
 

alvinoo

Member
Outlook version
Outlook 2019 64-bit
Email Account
Office 365 Exchange
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
 
Similar threads
Thread starter Title Forum Replies Date
P unflag sync'd emails Using Outlook 3
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
E Don't want Inbox shown when login box is shown Using Outlook 1
B Copy/Move Exchange inbox to Pop inbox Using Outlook 4
S Send email via SMTP - use transport rules to add to senders inbox (then rule to move to sent items Exchange Server Administration 1
S Accepting meeting request from calendar keeps the meeting request in the inbox Using Outlook 2
S VBA Code to move mail items from search folder to inbox subfolder Outlook VBA and Custom Forms 4
F want inbox on toolbar to reference icloud messages Using Outlook 2
E Inbox field customization Using Outlook 1
M Ensure the same inbox view across multiple outlook instances Using Outlook.com accounts in Outlook 7
Diane Poremsky Category Color doesn't Display in Inbox New Slipstick.com Articles 0
Hudas VBA find and open an email without looping thru each email in the inbox Outlook VBA and Custom Forms 1
E How to find or recover Lost e-mails within a folder under Inbox? Using Outlook 2
A Can't add a column called "name" to Inbox? Using Outlook 1
S Merge Emails with attachments with inbox rule to forward Using Outlook 5
V Not displaying newest messages in Inbox Using Outlook 10
Yasemin Nielsen Combined inbox outlook 2016 Using Outlook 2
D How to Run a Report Based on Age of Inbox Items Outlook VBA and Custom Forms 0
R Tasks showing up in inbox? Using Outlook 15

Similar threads

Top