Is there a way to open “First Attached” file automatically in web when document is opened. Something like “Launch First Attachment” option in Form properties. It does not work on Web.
Subject: Automatically Launching Attachment in Web.
Good question.
First thought I had was that this wouldn’t be possible. Secondly, after talking to a friend (Anil Vartak), this might be possible anyway. You might be able to parse the htmlpage in a body onload script, and then figure out if there is a attachment attached to the document. The way to do this, would be to check the links collection in Javascript.
Well, this link collection returns a collection of every href on your page. Meaning again - you can search through the array of these, to find typically href’s with “$files” in the strings, which in Notes/Domino is attachments within the document. So, when you find the first “$files” link - do a window.open on this url, and stop parsing the link collection array. Voila ! - You have opened the first attachment in the document!
Subject: RE: Automatically Launching Attachment in Web.
Thanks for a great idea. I was able to accomplish it by adding a simple line to onLoad even of my page/form. I only had one attached file and no other links so did not have to read in to an array or do parsing.