Why 2 different functions?

65 pts.
Tags:
ActiveX
Domino 6.5
JavaScript
I have created a domino application that is used in creating sales contracts. The contracts are word templates that the application administrator controls, and are stored as individual documents within the application. The end client enters the sales information (type of sale, payment method….) that is used to determine which type of contract is needed. When the status of the contract reaches a specified level, links are created to the templates needed. Here is the problem! I need to be able to open the word template and updated the word template all with one click of a button. Currently I have 2 javascript functions, the first launches the ?OpenElement link, and the second uses activex to take control to the currently opened template and update it with information. I execute the first function to open the template, I then have to go back to the browser and execute the second function to get the template updated, this process works but if a try to combine them into one function I receive an activex error “automation server can’t create object”. function launch_attachment (loc) { window.open(loc); } function populate_Doc() { var w= GetObject("","Word.Application"); w.Visible = true; obj= w.activedocument obj.FormFields("fld1").result = "XXXXX” }
ASKED: July 8, 2009  7:03 PM
UPDATED: July 8, 2009  11:08 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Answered my own question. I removed the ?OpenElement from the URL string, gave Annonmous reader access and modified the code as follows. The attachement opens and then updates the fields all without having to extract the file to the local PC or have the attachment stored on the document.

function launch_attachment (loc) // loc is the passed URL string
{
var w= new ActiveXObject(“Word.Application”);
w.Visible = true;
obj= w.documents.open(loc)
obj.FormFields(“?”).result = “XXX”

}

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following