I’m trying to create a button that will allow users to replicate their server mail file locally on their systems. I have a button that does this currently, but I have to edit the button manually every time I want to send it out to a user. So, I believe I can leverage @Picklist to grab the information I need to then create the button and put it into a New Memo. The problem is I don’t know what I’m doing.
@PickList([Name] : [Single])
THEN THE BUTTON
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim replica As NotesDatabase
Set db = session.GetDatabase("SERVER", "\mail\USERNAME.nsf")
Set replica = db.CreateReplica("", "c:\notes\data\mail\USERNAME.nsf")
End Sub
THEN PUT INTO A NEW MEMO (I don’t want to mailsend because I want to see the email).
Subject: Use a field on the message or simply do the lookup in the button.
So, two possible solutions:
a) when your user clicks the button and executes your code, it can access fields on the mail message. You could modify your agent code to get the UIworkspace, then the current document (the mail doc) and grab a field that you set before sending with your picklist function. Name it something like btnUsername.
b) You can also obtain the username of the client who is clicking the button from the Notessession and then you could simply do a lookup to your Directory to get the mailfilename. This way the button is more generic and says you the trouble of having to select the name in the picklist every time you use it.
c) (bonus) you could go further and modify your mailtemplate databaseOpen event to check if it’s being opened on the server and then see if the client has a local replica, and if not, simply create it then.