Detect Google Drive and OneDrive links in incoming mail

Status
Not open for further replies.

gruiz

New 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!
 

Diane Poremsky

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

gruiz

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
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!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
B Can not start Microsoft Office Outlook. Errors have been detect in the file. It said, close Outlook 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
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
L trying to download a google app that alows me to sync outlook with the droid x. Can you assist me in the process? Using Outlook 1
D syncing emails from google Using Outlook 4
H Lost ability to sync MS Outlook 2007 Calendar and Google Calendar Using Outlook 4
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
J Outlook2010 (beta) is not indexed by Google Desktop Using Outlook 2
E Google MAPI account Outlook VBA and Custom Forms 4
G Error in Outlook Object Model with redemption and google apps prem Outlook VBA and Custom Forms 3
R Reinstall to a different drive or folder Using Outlook 1
J Saving attachments from specific sender (phone number) to specific folder on hard drive Using Outlook 3
Diane Poremsky Save Attachments to the Hard Drive New Slipstick.com Articles 2
O How to move contacts folder image of a drive Using Outlook 1
Jessica .msg file saved in network drive appearing in Deleted Items folder Using Outlook 3

Similar threads

Top