hello,
i Want to open a Vaulted File in Word, in the programmers guide there is the code in Javascript but i implement with c# and i don't find the code in c#. Any suggestions? Thank you.
7.25 Want to open a Vaulted File in Word
JavaScript
// Prompt the user for the file name and retrieve the File item
var docName = prompt("Enter the Document Name:","");
var innovator = this.getInnovator();
var docItem = innovator.newItem("Document","get");
docItem.setProperty("keyed_name",docName);
var relItem = innovator.newItem("Document File","get");
relItem.setAttribute("select","related_id(keyed_name)");
docItem.addRelationship(relItem);
docItem = docItem.apply();
if (docItem.isError()) {
top.aras.AlertError("Document Not Found: " +docItem.getErrorDetail());
return;
}
var folder = top.aras.getWorkingDir();
var results, fileName;
if(docItem.getRelationships().getItemCount() > 0)
{
results = docItem.getRelationships().getItemByIndex(0).fetchFileProperty("related_id",folder+"\\", 0);
fileName = docItem.getRelationships().getItemByIndex(0).getRelatedItem().getProperty("keyed_name");
}
if (results.isError()) {
top.aras.AlertError("Unable to retrieve the file from the vault");
return;
}
// Open the file in Word.
try {
var word = new ActiveXObject("Word.Application");
word.visible = true;
word.documents.open(folder + "\\" + docName);
} catch(e) {
top.aras.AlertError("Unable to launch Word. File saved as: "+folder + "\\" + fileName);
return;
}