How to use lotusscript to change reply to address

I am using a VBA script using lotusscript to copy excel cell data and paste into a newly created memo. I am able to fill in the fields such as subject, to, cc, bcc.

From a excel macro, this script creates a new memo and the user verifies the content and hits send in lotus notes client.

The only problem is we still have to click on [Delivery Options], then [Advanced], and then fill in an email address into the field [Replies to this memo should be addressed to:]

I attempted to ‘guess’ at what this field is in my script, but cannot guess the right one, I get message “Run-Time error ‘7412’: Notes Error - Cannot locate field”

Can someone let me know what this field is called or another way of doing this?

Here is my code.

Dim Notes As Object

Dim db As Object

Dim WorkSpace As Object

Dim UIdoc As Object

Dim UserName As String

Dim MailDbName As String

Set Notes = CreateObject(“Notes.NotesSession”)

UserName = Notes.UserName

MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & “.nsf”

Set db = Notes.GetDataBase(vbNullString, MailDbName)

Set WorkSpace = CreateObject(“Notes.NotesUIWorkspace”)

Call WorkSpace.ComposeDocument(, , “Memo”)

Set UIdoc = WorkSpace.CurrentDocument

'Copy the email address from cell C19 into the TO: field in Lotus Notes

'Note: Addresses in this cell should be separated by a semicolon

Recipient = Sheets(“Sheet1”).Range(“C19”).Value

Call UIdoc.FieldSetText(“EnterSendTo”, Recipient)

'Copy the email address from cell C20 into the CC: field in Lotus Notes

'Note: Addresses in this cell should be separated by a semicolon

ccRecipient = Sheets(“Sheet1”).Range(“C20”).Value

Call UIdoc.FieldSetText(“EnterCopyTo”, ccRecipient)

'Copy the email address from cell C21 into the BCC: field in Lotus Notes

'Note: Addresses in this cell should be separated by a semicolon

bccRecipient = Sheets(“Sheet1”).Range(“C21”).Value

Call UIdoc.FieldSetText(“EnterBlindCopyTo”, bccRecipient)

Call UIdoc.FieldSetText(“EnterReplyTo”, “testingemail@notworking.com”)

^^^^^^^^^^^

This is what I can’t figure out.

Any help is appreciated.

Thanks in advance.

Subject: How to use lotusscript to change reply to address

Funny – my Memo form doesn’t have an EnterReplyTo field. It does, however, have a ReplyTo field (on the DelOptionSubform subform).

Subject: RE: How to use lotusscript to change reply to address

Yes, in all the script I have found, I see the field is called "ReplyTo"However, this does not work. I get cannot locate field.

The EnterSendTo field used to be “SendTo” in an older version of lotusscript, but has been changed to EnterSendTo.

Thus, I thought the ReplyTo may have been changed to EnterReplyTo, but this does not work.

I just need the field name for the new memo and it will work, but I dont have a listing of all field names.

The area I go to is

New Memo

Delivery Options…

Advanced

Replies to this memo should be directed to…

And there is a searchable field where I can put an email address or search from the directory.

Does this explain better?

Subject: RE: How to use lotusscript to change reply to address

Both SendTo and EnterSendTo exist – EnterSendTo is user-editable, while SendTo is a cleaned-up version of the editable field. ReplyTo is a hidden field on the Memo form (when the DelOptionsSubform is loaded), which may be your problem. Rather than using FieldSetText, set the back-end item value directly:

Call Uidoc.Document.ReplaceItemValue(“ReplyTo”, “testingmail@notworking.com”)

Subject: RE: How to use lotusscript to change reply to address

Stan,

Many Many thanks to you. THis works. I knew I was doing something wrong. I very much appreciate your help. This is exactly what I was looking for.

Sincerely,

Robert