This code worked beautifully in 5.10. We have upgraded to 6.5.3 and now the UIDOC is displaying the backend document and not the new document for editing. I’ve tried everything, to no avail, and can’t figure out why this is happening. What I’m doing is a collection of documents from a view selection, grabbing one field value for creating a temp variable, then passing it to a new form, an email memo, and placing that value as well as other values from the original doc into the email memo. Before, this worked just fine. Now it’s giving me a blank version of the original form instead of the email memo for viewing and editing. Hopefully, someone knows how I can get this to work again. Here is the code:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
'Collect all the documents selected by the user
Set collection = db.UnprocessedDocuments
Dim SetDate As String
Dim TwoWkeMailDte As String
Dim BccTo As String
Dim BccList As String
BccList = ""
i = 0
For i = 1 To collection.Count
Set doc = collection.GetNthDocument( i )
doc.EditMode = True
BccTo = doc.EMail(0)
BccList = BccList & BccTo & ","
SetDate = Today()
doc.TwoWkEmailDte = SetDate
Call doc.Save( False, True )
Next
Dim workspace As New NotesUIWorkspace
Dim doc1 As NotesDocument
Dim item As NotesRichTextItem
Set uidoc = workspace.CurrentDocument
Set doc1 = New NotesDocument(db)
doc1.Form = "Memo"
doc1.BlindCopyTo = BccList
doc1.Subject = "Reminder of Upcoming Training, Course Name: " + doc.Course(0)
Set item = New NotesRichTextItem( doc1, "Body" )
Dim longtext As String
longtext = "This is a reminder that you are scheduled to attend the training course " & Trim$(doc.Course(0)) + " on " & Trim$(doc.CIDate(0)) + _
" being held at " & Trim$(doc.TrngFacAdd(0)) +" from " & Trim$(doc.CIHours(0)) +". If you are unable to attend, please notify this office."
Call item.AppendText( longtext)
Call doc1.Save (False, False)
Set uidoc = workspace.EditDocument(False, doc1)
End Sub