Call a Public Sub when a Flag is clicked on in the Message Preview pane

Not open for further replies.


Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server 2013
Hi All,

I am trying to Call a Public Sub saved under a module in my Outlook Project 1, via a Sub in my ThisOutlookSession. But have had no success.

What I need is to trigger the macro in a module with name - Public Sub SetCustomFlag(), when I click on the Flag icon in the message priview pane

The macro Public Sub SetCustomFlag(), works fine by itself in a module, and when I call the macro externally. And now I am trying to automate the process, everytime I click the flag icon on the message preview.

Thank you for your valuable suggestions.

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
This macro at Create a Task when a Message is Flagged shows how to do something when a message is flagged - i do everything in the macro in thisoutlooksession - but could split it into two - the macro would call the second macro like this:
SetCustomFlag item

then name the next macro
Public Sub SetCustomFlag(item as mailitem),
Not open for further replies.
Thread starter Similar threads Forum Replies Date
CWM030 Call me old if you want. OL 2016 font size out of the box. Using Outlook 3
F Outlook 2016 call to Stop Timer Event Outlook VBA and Custom Forms 4
C Unchecking "Send immediately when connected" does not work on apps that call Outlook Using Outlook 1
M How to call custom email form when sender = x Using Outlook 3
D Create additional custom flag descriptions (other than Send E-Mail, Call etc.) Using Outlook 1
N Business Contacts - Call list to include company name Using Outlook 2
J this operation has been cancelled due to restrictions on this computer, Call your system administrat Using Outlook 2
R Do you run Exchange 2010 UM and use call answering rules? Exchange Server Administration 3
T Voicemails from Unified Messaging are showing the extension of the IP Gateway when a call is placed from an external number Exchange Server Administration 1
S need phone number to call for help with outlook 2010. Using Outlook 2
J When I try to click on a link embedded in an email I get an error that says that computer restrictions prevent access. Call the system administrator Using Outlook 1
K Find Me in Call Answering Rule tells callers 'One is not valid' but then dials out anyways Exchange Server Administration 2
R Exchange 2010 UM does not re-direct the call to Exchange 2007 UM server Exchange Server Administration 1
B I am know recieving double email after the first fix. My case number is: # 1140252913. I rep tried to call me tonight but could not get the nubmer. Using Outlook 3
K call a help file when click on a button xml ribbon Outlook VBA and Custom Forms 1
C OL Sub through or by Excel Macro Call Outlook VBA and Custom Forms 1
S How to call a procedure from a custom command bar in Outlook 2007 Outlook VBA and Custom Forms 1
R Phone Call Start Date - Phone Log BCM (Business Contact Manager) 1
B Good Call Log Concept? Outlook VBA and Custom Forms 5
J Outlook custom form - VBS call VBA macro Outlook VBA and Custom Forms 3
T exception when I call ActiveDocument.Range(0,0).Editors.Add(-1) Outlook VBA and Custom Forms 2
D Call add-in method from macro? Outlook VBA and Custom Forms 1
M Phone Log Reminder to call back BCM (Business Contact Manager) 1
R Help, Outlook2003 won't quit after call OnDisconnection? Outlook VBA and Custom Forms 3
S Custom VBA forms in Outlook--how to call w/macro? Outlook VBA and Custom Forms 1
C How do you call a exe and interact with the output interactively Outlook VBA and Custom Forms 2
A Created a personal group that now appears to be a public group Using Outlook 3
A Prevent connection to Public Folders on Exchange? Exchange Server Administration 3
R Copy Outlook Public Folders to a File Server Shared Folder Using Outlook 0
J Calling a Public sub-routine from the script editor via VB script Outlook VBA and Custom Forms 4
F How to assign a task to a public task folder? Using Outlook 1
D How to handle filing of emails from an Inbox Subfolder to a specific Public folder Using Outlook 1
D Record Appointment to Calendar on "Public Folder" Outlook VBA and Custom Forms 13
R Problem with searching public folders Exchange 2013/16 Exchange Server Administration 2
C Outlook 2016: Searching in all (+public) folders Outlook VBA and Custom Forms 9
X Delay sending an email until the next working day (public holidays) Outlook VBA and Custom Forms 0
L Public folders permissions Exchange Server Administration 1
Diane Poremsky Mail-enable Exchange Public Folders New Articles 0
K Macro to search emails between two time slots on public folders with excel export Outlook VBA and Custom Forms 12
Diane Poremsky How to Send Email When Traveling or Using Public Wi-Fi New Articles 0
Diane Poremsky Data loss may occur during public folder migration New Articles 0
S Empty an Office365 public folder containing 20.000 messages Using Outlook 2
D Priasoft Public Folder Syncro? Exchange Server Administration 0
I Random Chinese characters in email copied from a pst file. Exchange Server 2016 Public Folder Exchange Server Administration 1
T Create new item in public folder using VBscript Outlook VBA and Custom Forms 1
P Public Folder email error, ndr returned. Exchange Server Administration 1
J Favorites in Public Folders issue Outlook VBA and Custom Forms 0
P Last Change attribute set after viewing a public folder contact Exchange Server Administration 0
L any ways to create shortcuts to a public mail folder Using Outlook 4
L Should public contacts folder appear in "People" nav pane? Using Outlook 1
Similar threads