views:

84

answers:

1

My Lotus Notes document has a rich text item that stores an attachment. I want to edit the attachment and after this to save the attachment back to the Lotus Notes document. This is the script that launches the attachment:

@Command([EditGotoField];"Attachment");  
@Command([EditSelectAll]);
@Command([AttachmentLaunch]);
@Command([EditDeselectAll]) 

This script opens the attachment, but the changes made are not reflected to the Lotus Document. One way of solving this is to add AttachmentActionDefault=2 as an entry to the notes.ini. This enables to edit the attachment when double clicking on attachment. Also using the right click on the attachment, and then choosing edit action, produces the same result. In both cases, after saving, the changes are reflected back to the Lotus Notes document. The problem is that I want to use a button for opening the attachment.

A: 

Maybe you could try adding this formula before your code to set the environment variable in notes.ini.

@SetEnvironment("AttachmentActionDefault"; "2");

I'm not sure if this is the type of preference change that requires a restart of Notes, but it is worth a try.

Ken Pespisa
I can set this with Formula as you said or by editing the notes.ini file. It's the same thing. But I want to do this by pressing a button and not by double clicking on the attachment. I wish that AttachmentLaunch command would had a parameter(the value that is set for AttachmentActionDefault). That way it would be possible to use a button.
Seitaridis
Right, you can add the @SetEnvironment formula to your button's code. Like I said, no guarantees it will launch the attachment in edit mode, but see if it makes a difference.
Ken Pespisa
It will launch the attachment in edit mode only if I double click on the attachment. In the button's code I need something to generate the double click.
Seitaridis
I did some more digging and it is possible this is purposefully not supported. I didn't see any options using formulas, so I looked at what was possible via LotusScript. Seems you can activate the attachment much like you are already doing, but there's no way I can see to "edit" the attachment. The docs for the DoVerb method state "Verbs which require user interaction, such as Open or Edit, are not supported."
Ken Pespisa
I am using Lotus Notes 8.5.2 on my machine. If you choose edit from the attachment's right click menu the modifications made will be save. I've noticed that after you choose open from the right click menu, and make some changes, the changes will also be saved. Maybe you can reproduce this on your machine.
Seitaridis
That may be true, but my point is that editing an attachment still requires user interaction and can't be automated via LotusScript or Formulas.
Ken Pespisa