Wanted to move this action from a form to a view, but I'm getting a variable not set error? All I want to do is be able to run the action to multiple docs. Can it be done?
Sub Click(Source As Button)
Dim ws As New notesuiworkspace
Dim session As New notessession
Dim db As notesdatabase
Dim uidoc As notesuidocument
Dim doc As notesdocument
Dim cd As String
Set uidoc = ws.currentdocument
Set doc = uidoc.document
Set maildoc = session.CurrentDatabase.CreateDocument
With maildoc
.Form = "Form name"
.SendTo = "Send to"
.CopyTo = "copy to"
.Subject = "Subject"
.ComputeWithForm False, False
.Send True
End With
Call uidoc.save
Call uidoc.close
End Sub
Sub Click(Source As Button)
Dim ws As New notesuiworkspace
Dim session As New notessession
Dim db As notesdatabase
Dim uidoc As notesuidocument
Dim doc As notesdocument
Dim cd As String
Set uidoc = ws.currentdocument
Set doc = uidoc.document
Set maildoc = session.CurrentDatabase.CreateDocument
With maildoc
.Form = "Form name"
.SendTo = "Send to"
.CopyTo = "copy to"
.Subject = "Subject"
.ComputeWithForm False, False
.Send True
End With
Call uidoc.save
Call uidoc.close
End Sub