Hi Massimo,
You could have Vault Extension that can get the WebServiceManager in one of the CheckinFileEvents.
http://adndevblog.typepad.com/manufacturing/2013/06/get-webservicemanager-in-a-vault-event-handler.h...
I tested this from the Vault Word Add-In using this SDK sample:
C:\Program Files (x86)\Autodesk\Autodesk Vault 2015 SDK\vs12\CSharp\RestrictOperations
Below are some snippets that I added to that sample. When I check in a file from Word I see my events getting called.
DocumentService.CheckinFileEvents.GetRestrictions += new EventHandler<CheckinFileCommandEventArgs>(CheckinFileEvents_GetRestrictions);
//WB added
DocumentService.CheckinFileEvents.Post += new EventHandler<CheckinFileCommandEventArgs>(CheckinFileEvents_Post);
DocumentService.CheckinFileEvents.Pre += new EventHandler<CheckinFileCommandEventArgs>(CheckinFileEvents_Pre);
...
//WB addedd
void CheckinFileEvents_Post(object sender, CheckinFileCommandEventArgs e)
{
IWebService webService = (IWebService)sender;
Autodesk.Connectivity.WebServicesTools.WebServiceManager wbSrvMgr;
wbSrvMgr = webService.WebServiceManager;
var propDefs = wbSrvMgr.PropertyService.GetPropertyDefinitionsByEntityClassId("FILE");
PropDef ProviderPropDef = null;
foreach (var propDef in propDefs)
{
if (propDef.SysName == "Provider")
{
ProviderPropDef = propDef;
break;
}
}
// need to get a File.Id for GetProperties, e passed in only has the FileMasterId
FileArray[] myFileArray = wbSrvMgr.DocumentService.GetFilesByMasterIds(new long[] { e.FileMasterId });
File myFile = myFileArray[0].Files[0];
// get the value of the Provider from the file
PropInst[] props = wbSrvMgr.PropertyService.GetProperties("FILE", new long[] { myFile.Id }, new long[] { ProviderPropDef.Id });
// only want to try and display the value if it is something
if (props[0].Val != null)
{
MessageBox.Show("File checked in by " + props[0].Val.ToString());
}
}
In my first reply I thought you were trying to get the login from the Vault Add-In so you would not have to have the user log in again.
There is not any API for the Vault Office Add-In. These posts on the Vault idea station are related to the CAD Vault Add-Ins.
http://forums.autodesk.com/t5/vault-ideastation/api-access-to-vault-inventor-add-in-and-other-cad-ad...
http://forums.autodesk.com/t5/vault-ideastation/vault-api-enhancements/idi-p/5566309
Thanks,
Wayne
Wayne Brill
Developer Technical Services
Autodesk Developer Network