Question : Lotus Designer: Button to open shared resource

Hi

I dispair at Designer help, I am learning the formula code by trial and error at the moment and it is usually going well.

I now have an issue where I am stumped....

My nsf has a PDF as a shared file resource and all clients have 7.02 Notes and Acrobat Pro installed. All I would like to achieve is to have an Action button on the document that opens the file resource in an Acrobat window. I cannot find the correct formula syntax in the Help file. Am I blind?

Any help would be appreciated, all I need is the formula syntax...

All the best, many thanks

Answer : Lotus Designer: Button to open shared resource

What you're asking for is pretty complex.  Here are the steps that you would need to perform...

(1) Store the PDF in a backend document (it cannot be a part of the form because, as you said, the users cannot edit it).
(2) Add a button to the form to extract the file from the backend document to a temp location.  Example:

      Dim sess As New NotesSession()
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Dim obj As NotesEmbeddedObject
      Dim strFilePath As String
      Dim arrFileNames As Variant
      Set db = sess.CurrentDatabase
      Set doc = db.GetDocumentByUNID("")
      arrFileNames = Evaluate("@AttachmentNames", doc)
      If (Isempty(arrFileNames)) Then Exit Sub
      Set obj = doc.GetAttachment(arrFileNames(0))
      strFilePath = "c:\temp\form.pdf"
      Call obj.ExtractFile(strFilePath)

(3) Add code to lauch the PDF (I use Win32 code for this).
(4) Wait for the user to fill out the form.
(5) Place code in the NotesForm's QuerySave or PostSave events to store the file in the NotesDocument (making sure that the file is not still locked by Acrobat).

... That's a lot of work.  Are you sure that you wouldn't rather use a standard NotesForm than the PDF?
Random Solutions  
 
programming4us programming4us