Hi,
I have documents in a view in which I’d like to open each document, edit the document and then save and close it. This is my code that I was trying to use - I tried it on a couple of documents, but it actually opened the document, left it open, and didn’t seem to edit the document anyway! If anyone can help that would be great.
Sub Initialize
Dim session As New NotesSession
’ Dim db2 As New NotesDatabase(“Abeckett”, “QoN\Staging\DPCAnswers.nsf”)
Dim StagingDatabase As NotesDatabase
Dim FromView As NotesView
Dim Workspace As New NotesUIWorkspace
Dim SourceDoc As NotesDocument
Dim destdoc As NotesDocument
Dim nItem As NotesItem
Dim Acount As Integer
Dim EmailAs() As String
Dim x As Integer
Dim Body As String
Dim ActionType As String
Dim currentdb As NotesDatabase
Dim UiDoc As NotesUiDocument
Dim UiView As NotesUiView
Set UiView = workspace.CurrentView
Set currentdb = session.CurrentDatabase
Set FromView = currentdb.GetView("Questions By Number")
Set SourceDoc = FromView.GetFirstDocument()
Acount = 0
’ FromView.AutoUpdate = False
While Not (SourceDoc Is Nothing)
’ SourceDoc.QuestionText = “A”
Call Workspace.EditDocument(True, SourceDoc)
Call SourceDoc.Save(True, True, True)
Set SourceDoc = FromView.GetNextDocument(SourceDoc)
Wend
End Sub
Cheers,