How to email dropbox app file paths as clickable hyperlinks? - vba

The company uses dropbox instead of local servers. We often send files to colleagues, but each user has a unique path to the file stored in the dropbox desktop app (e.g. C:\Users\username\Dropbox...).
I was thinking about writing a batch script to copy a file path and strip the beginning of the path. I would then need another script to add the user specific prefix to the file path, and then open the folder/file in file explorer.
I believe I found a way to add a batch file into the menu that pops up when you right click a file/folder by editing the registry. I was thinking it would be possible to write an Outlook add-in for the receiving user to prepend their drive/username etc. to the file path and then open the file/file explorer if a path to a folder is sent.
I was hoping to get some input on this approach, or to know if there is an easier way to handle this. I haven't started any of the code yet.

Why don't you just start using the Dropbox add-in for Outlook?
Dropbox has created an add-in that integrates with Microsoft Outlook. By connecting the Dropbox add-in to your Outlook account, you can:
Replace email attachments with a shared link to any file, big or small
Save email attachments that you receive directly to your Dropbox account
Ensure those with access to a file see updates to it (since shared links always point to the latest version of a file, whereas attachments are just a static copy)
Enabling the integration adds a Dropbox icon to the Outlook compose window. When you click this icon a pop-up window appears, allowing you to select from the contents of your Dropbox. A shared link to any selected file or folder will appear in the body of the email.
While this link looks like an attachment, it's, in fact, a shared link. This means no slow-down in sending emails, and no space limitations in your inbox.
Anyway, if you still want to develop an add-in for extracting an attachment's file path you need to start with Walkthrough: Create your first VSTO Add-in for Outlook.
The NewMailEx event of the Application class which is fired once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem and etc. The EntryIDsCollection string contains the Entry ID that corresponds to that item.
The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. Use this method with caution to minimize the impact on Outlook performance.

Related

Catching "move to explorer" event from Outlook

Recently I have written small tool (vb.net WinForms) for our company that creates structure and archives all Emails that are in x, y Folder in Outlook. This tool then renames and converts these .msg files to .eml files.
Now it would be perfect, if these Emails would automatically convert themself when user places it directly in the destination in Windows-Explorer folder per Drag and Drop. For that I assume I would have to run script/programm whenever Event X (moving Email from Outlook to explorer) occurs.
Has anyone an idea if catching that event would be possible? Or maybe any better ideas? I thought of some scripts that run on server and check for new files (once daily for example), but the first solution is more appearing to me.
You can catch the Items.ItemAdd event on the folder to track and convert new items.
The Outlook object model doesn't provide any events when items are saved to a folder by dragging and dropping items. You can use a file system watcher to track folder changes, see VBA monitor folder for new files for more information.

Creation of an unique link to an outlook e-mail

Background:
Since all tasks, are more or less assigned per E-mail I want track the e-mail via a link in other programs (Project, Planner, Word, Excel, OneNote, ect). This should be possible via the globally unique identifier GUID of the Outlook message & the Outlook URL Protocol.
I can only find instructions on this for older versions - which does not work.
BTW: Tracking via searching on subjects is a pain, since subject changes and conversation history can be long.
Question:
How do generate a link to the e-mail in outlook 365 which is unique and can be opened in other programs (Project, Planner, Word, Excel, OneNote, ect)?
There are other ways possible? Add-in?
This should be It should be possible!
However I do not know how it works with Office 365 --> Pls see following website:
https://www.davidtan.org/create-hyperlinks-to-outlook-messages-folders-contacts-events/
Excerpt out of it:
The Windows operating system recognizes the outlook: tag and whenever it sees that it’s part of a link, it triggers outlook to do something. Depending how you format the hyperlink, you can open messages, folders, contacts and meetings stored in outlook from websites, documents (Word, OpenOffice etc), Excel spreadsheets and powerpoint presentations stored either locally or even over a shared network.
How To Link To Outlook Items:
Outlook Paths
Outlook provides a way to link to any Outlook item using a URL. It can be “path based” like this:
– Outlook:Inbox\
– Outlook:Personal Folders\Contacts\~John Doe
Outlook GUID
You can link to a globally unique identifier (GUID) that is created for an item and doesn’t change when you rename or move it:
– Outlook:000000000EAE44933247899468AC478B81C0BANDHEWR324
It is best to use the GUID URL since you don’t have to worry about changes breaking the link.
If you are after a outlook message, all you have to do is select that message in outlook, and then left-click on the linker icon on the lower right of the taskbar so that the link will get copied. Next, you will just have to paste it somewhere. It works the same way for contacts and even calendar events.
By default, the copied link will be something like this
Email subject here
If you are building a webpage using HTML, then you can merely copy and paste that code to the HTML file, and maybe just changing the link text.
However, if you are working in Excel, what is important is only the part that says:
Outlook:00000000CC63759F18171E46835E96E44971FDFB07006446
In Excel, press CTRL-K in a cell, enter any text you want to be displayed, and paste that piece of code above (ex. outlook:123437654) at the address section. That’s it.
However it does not work with OFFICE 365. May you can help me?
KR Christian

Tracking open Outlook 2010 emails

I'm looking for a programmatic way (eg: using VBA) to write the Subject texts of emails which are open, or otherwise export opened emails to a file system folder.
Trap the Application.Inspectors.NewInspector event an read the Inspector.CurrenmtItem.Subject property. Reading pane needs to be handled separately.

Outlook automatic archive on network drive

Am I able to use Outlook to automatically link a folder in outlook with a folder on the network drive?
Let's say I want to use VBA to modify a folder called "New York Store" within outlook. I would like to modify the folder, so whenever I put an email into this folder, it will save the email on a destination on the computer such as "X:\Stores\Outlook Archive\New York Store", and when it has done so, it permanent delete the email from Outlook?
Is it possible to modify a folder (by VBA or something else) to save the email(s) within a folder, and when it has done so, delete the emails from Outlook permanently?
Please let me know, if this is possible :)
To answer your question: Yes. It is possible. You'll need to brush up on programmatic folder control and find a way to "watch" the folder for new items.
Is there a reason that there has to be a folder involved? You'd save a few steps with something like a custom button on the Mail Item ribbon to save to file and delete message.
Or, considerably fewer keystrokes:
F12EnterDel
It will work on one or more items, no additional folder required, and after the first time you save an item at your location X:\Stores\Outlook Archive\New York Store it will default to that folder.

VB Code to Close Open Subfolders in Outlook

Outlook has an habit of opening sub-folders if an email has been sent to it automatically (through rules). There is no way to turn off this feature.
Does anyone have ideas for code that would periodically (say every 30 seconds), automatically collapse all subfolders within, say, the sent items folder?
Thx
The Outlook object model doesn't provide anything for collapsing folders in the navigation pane.
The Starting Outlook with all folders collapsed/expanded states the following:
To keep the mailbox collapsed even when a new message is being delivered, make sure that your Inbox and other folders that receive email (for instance by a rule) have been added to your Favorites list.