Jean Roch
Jean Roch

Reputation: 305

Word VSTO - Adding a tag to a Word file

I'd like to mark documents processed by my add-in in such a way that the user can see it, but without affecting the contents of the document. In Word, if you go to the File menu you'll find you can add tags to your Word files. Those tags can be displayed in the Windows Explorer if you enable the "Tags" column. Tags can also be set from the Explorer.

I haven't been able to find how to access those tags programmatically. Can anyone give me a hint ?

Upvotes: 2

Views: 870

Answers (1)

didzispetkus
didzispetkus

Reputation: 131

You are looking for Document.BuiltInDocumentProperties.

For example:

var properties = (Microsoft.Office.Core.DocumentProperties)
             Globals.ThisAddIn.Application.ActiveDocument.BuiltInDocumentProperties;

properties["Keywords"].Value = "Processed by my add-in";

See more:How to: Read from and write to document properties

Upvotes: 4

Related Questions