Anyone have any advice / comments / words of wisdom on this?
I’m developing a DB which will have a form the user fills in and it send an e-mail with an attached button to add that information specified in the form. (Currently they manually edit the button and update the declaration section - I’m just trying to make it even easier). Anyway…
I’ve discovered, that if I append the current version of my button with subroutines - when the e-mail arrives we get the error message:
However, if I use the same button before I added the subroutines, it works fine. I can certainly live without the subroutines but I fail to understand why this makes a difference? Anyone have any advice?
I looked at this document and didn’t see anything that helped explain it: http://www-1.ibm.com/support/docview.wss?uid=swg21097112
My code to add the button:
Dim s As New NotesSession
Dim thisDB As NotesDatabase
Dim dc As NotesDocumentCollection
Dim thisDoc As NotesDocument
Dim EmailDoc As NotesDocument
Dim ButtonDoc As NotesDocument
Dim EmailBody As NotesRichTextItem
Dim TheButton As NotesRichTextItem
Dim searchstring As String
Set thisDB = s.CurrentDatabase
Set thisDoc = Source.Document
Set EmailDoc = thisDB.CreateDocument
If thisDoc.SentAlready(0) = "N" Then
thisDoc.SentAlready="Y" ' Yes I need to add a save
With EmailDoc
.Form="Memo"
.Subject = "Button Version 3.0 Alpha"
.SendTo="Stephen M Christian/DIV/ORG"
End With
Set EmailBody = New NotesRichTextItem (EmailDoc, "Body")
searchstring = |SELECT FORM="ButtonHolder"|
Set dc = thisDB.search(searchstring, Nothing,0)
If (dc.count = 1) Then
Set ButtonDoc = dc.GetNthDocument(1)
Set TheButton = ButtonDoc.GetFirstItem ( "TheButton" )
Call EmailBody.AddNewLine(2)
Call EmailBody.AppendRTItem(TheButton)
Call EmailBody.AddNewline(2)
Call EmailBody.AppendText("This is a test.")
Call EmailBody.AddNewline(2)
End If
Call EmailDoc.Send(False,EmailDoc.SendTo(0))
Set EmailDoc = Nothing
End If