Detect Google Drive and OneDrive links in incoming mail

Status
Not open for further replies.

gruiz

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Hello everyone! Security policies don't let me open Google Drive and OneDrive links at work, although I can see them on the email (don't ask... can't change that).

How can I detect this incoming emails to warn the sender that I didn't got his attached files? They believe the files arrived safe because no email is bounced and in fact the email arrived safely but not the attached files.

I can do that manually looking at each email but its a time consuming task. I saw that Google Drive shows as links that contains "drive.google" somewhere in the html and OneDrive are small files with .drv extension.

I would like to use VBA in Outlook to automatically send a reply with some predefined text replying that I didn't get those files and they must be sent as an attachment

Thanks!
 
You can use a run a script rule or itemadd macro - i'd probably use instr function and look for keywords in the body

Code:
strbody = item.body
if instr(1,strbody, "drive.google") > 0 or if instr(1,strbody, ".drv") > 0 then
'send reply
end if
This page has a sample macro for sending the reply
 
Thanks Diane! I'll further investigate since I need to apply it to emails already received. I'm using Access VBA from quite a long time, but Outlook's is a little bit different.

It seems that I would be some time reading all Outlook related things at slipstick.com to achieve what I want.

Is there any reading you can recommend me to get in touch with the Outlook VBA object model? Reading MS documentation right now but I mean real examples and not just properties and methods.

Thanks again!
 
Outlookcode.com had a lot of information but it's been offline for a while now.

Do you want to always run it yourself on selected messages? It's not difficult to change a run a script rule to manual - or to use both.

Use a 'stub macro' to trigger the script or replace 'YourMacroName objItem' with the code that does what you need. You need to make sure the object names match up - which you should know from Access VBA.

Code:
Sub RunScript()
Dim objApp As Outlook.Application
Dim objItem As Object ' MailItem
Set objApp = Application
Set objItem = objApp.ActiveExplorer.Selection.Item(1)

'macro name you want to run goes here
YourMacroName objItem

End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J Transport Rule to detect Keyword question.. Exchange Server Administration 2
T VBA outlook, detect priority emails Outlook VBA and Custom Forms 5
20 Ton Squirrel Detect Application_Startup event completion Outlook VBA and Custom Forms 1
M Outlook 2003 rule to detect a blank category Using Outlook 1
G detect if a mail is read in a public folder Outlook VBA and Custom Forms 14
M Another way to detect if email read? Outlook VBA and Custom Forms 6
M how to detect duplicate email messages? Using Outlook 5
A how to detect email is saved to draft? Outlook VBA and Custom Forms 3
J Detect logoff/shutdown Outlook VBA and Custom Forms 1
H How to get BCM in OUtlook 2007 on Vista to detect my MDF file? BCM (Business Contact Manager) 1
O Any 3rd party tool that sync (mirror) from Outlook Contacts to Google Contacts? Using Outlook 4
O Any 3rd party tool that sync (mirror) from Outlook Calendar to Google Calendar? Using Outlook 5
Victor_50 Problem - Google Workspace will stop "unsafe" access to Outlook end 2024 Using Outlook 3
icacream Outlook 2021 - Google calendar in the peek Using Outlook 0
D Wishlist How to use 'app password' in Outlook 2003 after Google pulled plug on "less secure apps" Using Outlook 2
Commodore Are newer versions of Outlook still "less secure" to Google? Using Outlook 22
S.Champ Please help? I've imported a random workcalendar I dont even know who's. Can I undo it? and then I need to re-sync the google one again. Its a mess:( Using Outlook 2
A Any way to make Outlook Calendar invitations look right to Gmail/Google Calendar users? Using Outlook 3
C WARNING - DO NOT USE AN OUTLOOK.COM ADDRESS FOR GOOGLE ACCOUNT RECOVERY EMAIL Using Outlook 10
R How to Sync *all* Google Workspace Mail Folders with Outlook 2019 (MS365) Using Outlook 3
R How to Change Margins In Google Docs...? Using Outlook 0
I Google Calendar <calendar-notification@google.com> appearing as a duplicate entry Using Outlook 2
J O365 - Adding Shared Google Calendar ICS link issue in O365 Using Outlook 0
GregS Outlook 365 blocked by Google popup Using Outlook 2
O Synchronising contacts Outlook 365 with Google v.v. Using Outlook 4
TomHuckstep Outlook 2016 Limit the number of days syncing from Google Calendar Using Outlook 1
B How to sync Outlook, iphone and Google calendars and contacts? Using Outlook 4
G Outlook VBA and Google Calendar ("Events") Outlook VBA and Custom Forms 1
D launching a link in google Using Outlook 1
Horsepower Google says Outlook 2016 is not a secure app Using Outlook 4
C Search with Google Macro? Outlook VBA and Custom Forms 4
N Importing Google contacts from CSV file removes recipient names in autocomplete list Using Outlook 0
M Google Apps Mail *SENT* from iPhone doesn't download to Outlook via POP3 Using Outlook 1
T bcc and Google imap Using Outlook 3
B synching outlook 2010 with google on android phone Using Outlook 6
C Odd error message not found in Google search Using Outlook 1
A Outlook 2013 IMAP using Google Mail App not syching Sent Mail Using Outlook 3
C Setting up Outlook 10 on Widows 8 using Google Server Using Outlook 3
A Recommend add-on or utility enabling quick Google search within Outlook Using Outlook 7
D Outlook/Google Configuration Using Outlook 27
S too difficult of a question to google Using Outlook 2
billzant RSS feeds and google Using Outlook 2
M How do I change the default map from Bing to Google in Outlook 2003? Using Outlook 23
I Links not working after un-installing Google Chrome Using Outlook 2
J Outlook Connector equivalent for Google Mail? Using Outlook.com accounts in Outlook 2
D Outlook 2010 registry hack - delete emails - Google Apps Using Outlook 0
R Outlook and google calendar stuck if I close outlook Using Outlook 1
C Sync Outlook Calendar and Google Calendar Using Outlook 1
F Google Desktop fails to index Outlook 2010 Using Outlook 3
N The add-in "C:\program files\google\google desktop search\googledesktopO..." could not be installed Using Outlook 32

Similar threads

Back
Top