We already have some code which allows a user to select multiple questions, and then hit a button which allows them to enter a standard response and answers all those questions with the same text. At the moment, just copies plain text as the answer, but I want to copy rich text and keep all the formatting.
Basically when a user hits the ‘Bulk Answer’ button, it presents them with a form which allows them to enter the standard response. I’m playing around with this form firstly to see if I can copy rich text, and this is where I’m having the problem. In the code I’ve been testing with, I want it to copy the rich text item (in ‘standard response’ field), and create a new document and paste the rich text from standard response in. When I do this, it comes up with an Object Variable not set error. I’ve looked through help and it seems like I’m doing it right, but obviously not! Thanks in advance, code is shown below:
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim Workspace As New NotesUiWorkspace
Dim UiDoc As NotesUIDocument
Dim Session As New NotesSession
Dim SelectedQuestions As NotesItem
Dim rtitem As String
Dim rtitem2 As String
'// If the user presses cancel then dont do anything
If Source.Document.CreateDocuments(0) = "No" Then
Exit Sub
End If
'// Begin Creating the Advice for each selected Document
Set SelectedQuestions = Source.Document.GetFirstItem("SelectedQuestions")
Dim DocA As NotesDocument
Set DocA = Source.Document
'// Create the Advice Documents
If (Source.Document.DocumentType(0) = "Advice") Then
Call CreateBulkAdviceForMany(SelectedQuestions)
Else
' '// Create the Answer Documents
'JUST TESTING
Dim database As NotesDatabase
Set Database = Session.CurrentDatabase
Dim logdoc As NotesDocument
Dim Testing As NotesRichTextItem
Dim dummyitem As NotesRichTextItem
Set logdoc = Database.CreateDocument
logdoc.form = "EventLog2"
Set dummyitem = Source.Document.GetFirstItem("StandardResponse")
Set Testing = logdoc.GetFirstItem("LogAction")
Call dummyitem.AppendRTItem(Testing)
Call logdoc.Save( True, True )
'JUST TESTING
End If
Exit Sub
End Sub