[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

A action button to open a embedded object

If a pick a place in my form and then

Create Object
Object From File
display as icon

What I need now is a button that when clicked the document opens.  I need help with the script.

1 Solution
Did not understood ...

if you are looking to open a document:
then @Command([opendocument])

for Embeddeding in an existing document or a new document, use:
@PostedCommand ( [EditInsertFileAttachment] )
JaziarAuthor Commented:
I am needing to place a word document in the form.  Each time a new document is created the base word doc is there.  In each document the user will make changes to the Word doc and save it.  So each document in the database will have a differnt word doc in it after the user had made changes.  I was advised in  a earlier question to embed the word doc as a ole object.  So I am needing a way for the user to click a button that will open the word doc for edit.  Right now if you double click the Icon it works, but for many users they need a simple button to click.
Sjef BosmanGroupware ConsultantCommented:
Wild guess:


Otherwise, I don't think this is possible :|
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Hi Jaziar,
take a look at Microsoft Office Library (7) template

You have it in your Data folder (no 7 is for LN version 7, put appropriate number there).

Hope this helps,
Jaziar, try this. not tested in R6

      Dim ws As New NotesUiWorkspace
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim wordOLE As NotesEmbeddedObject
      Set uidoc = ws.CurrentDocument
      Set doc = uidoc.Document
      'load the OLE
      Set handleV = uidoc.GetObject("MWD")      
      Forall o In doc.EmbeddedObjects
            If o.name = "MWD"  Then 'name of the embedded object. can be changed by accessing its property                  
                  Set wordOLE = o
                  Exit Forall
            End If
      End Forall
      If Not wordOLE Is Nothing Then
            Call wordOLE.DoVerb("&Edit")
            Msgbox "Word OLE not found!"
      End If      
JaziarAuthor Commented:
It opens MS WORD then you see a flash of the document and then it is gone, I am not sure if it closing it or what it happening for sure, but it is very close to working.
same prob testing it in r5. try to debug LS. see if it will close the doc.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now