How to make it work in both mail4.6 and mail6?

I have this code to forward document to pre-defined users.

This code only works for users who have Mail6

Set forward = ws.CurrentDocument

Call forward.save

Set forwarddoc = forward.Document

Call forward.FieldSetText(“EnterSendTo”, SendTo)

Call forward.send

This code only works for users who have Mail4.6

Set forward = ws.CurrentDocument

Call forward.save

Set forwarddoc = forward.Document

Call forward.FieldSetText(“SendTo”, SendTo)

Call forward.send

In Mail4.6 and Mail6, there are different fields. How to make it work in both mail version?

Thanks

Subject: How to make it work in both mail4.6 and mail6?

Dim a NotesSession and check .NotesVersion to determine which line of code to execute.

Subject: RE: How to make it work in both mail4.6 and mail6?

But we have users who are using Notes6.5 with Mail4.6

Users who are using Notes6 doesn’t mean their mail version is mail6.

Subject: RE: How to make it work in both mail4.6 and mail6?

Ahh. In that case maybe your 6.5 users can use the test forwarddoc.HasItem( “EnterSendTo” )

Subject: RE: How to make it work in both mail4.6 and mail6?

Thanks, it works great!

If forwarddoc.HasItem( “EnterSendTo” ) Then

Call forward.FieldSetText(“EnterSendTo”, SendTo)

Else

Call forward.FieldSetText(“SendTo”, SendTo)

End If

It works in both version.