What storage should I use for a outlook plugin? - plugins

What storage system should I use , If i'm going to deploy a outlook plugin with VSTO ?
Is it possible to use outlook's , which is for email ?
UPDATE
I thought about SQL Express , but I think I should use the same thing with what outlook uses , that would save troubles

There are numerous options for you to consider, below I've listed all the ones I've seen used in the past.
For Outlook-managed storage you could look into using StorageItem which is a hidden item inside a given folder (Inbox, etc.). Using the StorageItem you can add custom user properties and file attachments.
You can also create new Folder and mark it as hidden using the PR_ATTR_HIDDEN flag. Adding any mail items or journal items would only be visible to your add-in since you can access hidden folders via the API - but not via Outlook interface.
I've also seen users store information inside Outlook journal items serialized as XML (as is done by jello-dashboard).
You could create a custom store via AddStore to construct a local PST.
Alternately, you could store data external to the Outlook system for consumption by your addin. External stores could be local Environment paths, local/remote databases, or web service calls.

Related

VS Code workspace storing additional script data

I wanna build external editor for scripts stored in crm.
I have API which exposes script engine returning list of scripts containing ,script id, script name, content...
Editor will be Visual Studio Code plus my extension. Manage to build extension and get data, store scripts on in the folder and give them name from the response. Problem is in update, to send data back to the server i need to use id not the name.
Question: is there any kind of container in workspace where i can store all data related to every script such as Id?
Something like settings for every script containing scriptName:id, date, owner...
Maybe https://code.visualstudio.com/api/extension-capabilities/common-capabilities#data-storage can help? You can store data either locally, in the workspace, or globally, in the user' storage space. Can be simple key/value pairs, or your own format.

Persisting data in word document using office add-in

I'm trying to develop word add-in which allows to modify word content. One of the requirement is to select some text and mark it:
change its style (look) - and that is done
Associate that piece of text with some custom/hidden data, ex. an ID.
I want to somehow persist that data within the document, so that:
My add-in can read the document on the start and build a list of 'marked' elements
It should work on different machines - I can create a document on one machine, later open in on other machine, and add-in should be able to retrieve that data.
So far I tried to persist that data by first, getting data as HTML, and add attributes to tags, but that didn't work.
Also tried to add some hidden div, but it was only available during word app lifetime.
Recently, found this link: https://github.com/OfficeDev/Excel-Add-in-JavaScript-PersistCustomSettings , but still it allows to persist data in scope of "browser", so, I assume that on other machine it won't work.
What are my possibilities? Maybe I shouldn't store it within a document, but if not, where?
Developing it using office-js - it should work for both Word 2013 and Word 2016 (so I don't have an access to Word 2016 specific API).
Check out https://dev.office.com/reference/add-ins/shared/settings
The Office JS Settings object allows you to save custom data that persists with the document. It is pretty straight-forward to use. Getting settings is synchronous - saving settings is async. The biggest thing is that you have to remember to call Office.settings.saveAsync() after you have made your changes using Office.settings.set() in order to actually save the changes to the document.
Moreover to Nick's answer which is absolutely correct, you can use "Binding" mechanism.
Bindings are stored in document out-of-the-box, so that, you can access those later at any time.
An example, which fits my needs:
Select some text and click on button in add-in (to call some method)
Call addFromSelectionAsync() method (you can specify an id for it to reference it later)
Access it using getAllAsync() or getByIdAsync() method at any time you need it.
More about it: https://dev.office.com/docs/add-ins/develop/bind-to-regions-in-a-document-or-spreadsheet

Save Email as MSG file without using Outlook (COM object, etc.) or 3rd party software

Right now, I'm using the Exchange Web Services API with PowerShell to pull down specific emails from exchange and save them as EML files. This works great; however, the user/customer requires the emails to be in msg format. There are two ways that I've seen to do this:
Use Outlook/Outlook COM Object
Use a 3rd party library or software (like this: http://www.independentsoft.de/exchangewebservices/tutorial/downloadmessagetomsgfile.html)
Are there any other alternatives? I would like to stick with PowerShell if possible, but it seems like EWS might be limited to writing EML files.
There is no flexibility on the MSG vs EML requirement (compliance).
EDIT:
This will be run on a server; so I would prefer if this could be done without having Outlook installed.
You can still use PowerShell with the Outlook Object Model (OOM), if that's what you are hoping for.
You can also use Redemption, which has more features than OOM (it can also be run in a service, doesn't fire Outlook security prompts, etc.).
You can create an MSG file explicitly in your code (it is an OLE storage (IStorage) file and its format is documented) - parse the EML file, then populate various MAPI properties in the MSG file.
You can also use Redemption (I am its author). Converting an EML file to MSG is as easy as
RDOSession Session = new RDOSession();
RDOMail Msg = Session.CreateMessageFromMsgFile(#"c:\temp\YourMsgFile.msg");
Msg.Import(#"c:\temp\YourEmlFile.eml", rdoSaveAsType.olRFC822);
Msg.Save();

Store and Use Configuaration values in Alfresco Share

I have a custom developed share dashlet that has hardcoded values in use (For example the name of a Workspace to use as a default).
I would rather have the values placed into a configuration file and have the dashlet read the fileup at server start and work from there. I have two questions:
Which file can I use and where can I place the file?
How can I get the share dashlet to read the file contents and load the data into local variables?
I would advise you to leverage the PreferenceService, which can be accessed from a Share Web Script by consuming the following API exposed by the repository:
GET /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
POST /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
DELETE /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
In this way you will probably need to define some hard coded meaningful defaults, then let the user customize his experience and store the customized settings as user preferences.

Office integration (Word) - intercepting save

I am planning to implement a small in-house document management system. It must have a web GUI for managing a remote folder structure stored in a database. In these folders are word documents stored (physically as blob in a database). Whenever a user clicks on a document link, a word binary is downloaded via browser and (hopefully) opened in Word on the user's PC.
This is the easy part ;)
Now the user hits "Save" or Ctrl-S. I want to have a functionality programmed inside Word that calls a custom function (maybe in a .NET DLL) that uploads the saved file back to the server (HTTP). The hard part seems to me:
How to intercept the Save process to call the extension functionality
How to deploy this to multiple users
Mike's link to the question I answered should do it for intercepting the file save. The specific button idMso for File->Save is "FileSave"
To deploy it to several users machine you can either
Create a setup project that will create an msi that you can run on all the users machines
if it's an intranet scenario, you can keep the assemblies on a network location and just add the neceassary registry settings to all the users machines. This article should describe the settings that you need to include. You would just need to change the path setting to point to the network location.
AFAIK, this is what Alfresco is doing with its Microsoft Office Add-ins (never tested myself though). As Alfresco is open-source, it must be possible to look at what they are doing. Or just ask your questions on Alfresco's forums.
You can try to override "save" from the ribbon or build your own ribbon tab with the behavior you want. It may be trickier overriding "Ctrl-S".
Overriding the ribbon: StackOverflow Question
Video on altering a standard ribbon button: Office Developer Center