Solved

WARNING when Sending email from VBA in Access 97 through NOTES 6.5

Posted on 2006-06-23
10
1,385 Views
Last Modified: 2013-12-18
Whenever I open an email from Notes 6.5 that was created and sent through VBA in Access 97 I get the following warning to pop up multiple times:

A stored form cannot contain computed subforms.


This is the code I am using (please excuse the sloppiness. I usually clean up after it is working correctly):



Public Function EmailUsers_WsId()

Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf1 As Object
Dim eo1 As Object, eo2 As Object, eo3 As Object, eo4 As Object, eo5 As Object
Dim vFilePrim As String, vFilePath As String
Dim vFileEvl As String
Dim vFileExp As String
Dim vFileP3 As String
Dim vFileSt As String
Dim txt_Body As String
Dim txt_EAdd As String
Dim txt_Subject As String
Dim txt_Ecc As String
Dim txt_EBcc As String

'vFileName = "Enter Path for Desired Attachment Here"

DoCmd.Hourglass True

'Start new Lotus Notes Session
Set session = GetObject("", "Notes.NotesSession")

'On Error GoTo Oops

'This line will tell Access which network path and database must be activated
'to send mail. GetDatabase(pServer As String, pFile As String, [bCreateonfail As Boolean = True])
'By default it will use the active mailbox if both REQUIREd arguments are entered as ""
Set db = session.GetDatabase("<SERVER NAME REMOVED>", "mail\tgiaquin.nsf")


'Open Mail Database. This will prompt for a password if not already open-
'For full automation, Notes should already be open.
Call db.OPENMAIL
'Make new document
Set doc = db.CreateDocument

'Create body of message and email address
txt_Body = "SAMPLE TEXT. BODY NOT YET WRITTEN" & Chr(13) & Chr(13)

txt_EAdd = "Thomas Giaquinto"
txt_Subject = "SUBJECT DATE " & Date
'txt_Ecc = Nz(Forms![frm_sendem]![ctl_cc], "")
'txt_EBcc = Nz(Forms![frm_sendem]![ctl_bcc], "")

'Attachment path
vFilePath = "C:\Documents\"
vFilePrim = vFilePath & "1_Solutions.xls"
vFileEvl = vFilePath & "2_Solutions.xls"
vFileExp = vFilePath & "3_Solutions.xls"
vFileP3 = vFilePath & "4_Solutions.xls"
vFileSt = vFilePath & "5_Solutions.xls"

'Build e-mail
With doc
    .Form = "Memo"
    '.Form = "Reply"
    .SaveMessageOnSend = True
    .SendTo = txt_EAdd
    '.cc = txt_Ecc
    '.bcc = txt_Ecc
    .Subject = txt_Subject
    'Set rtf1 = .CreateRichTextItem(doc, "Body")
    Set rtf1 = .CreateRichTextItem(doc, "Body")
    'Import Text
    Call rtf1.AppendText(txt_Body)
    'Attach Files
    Set eo1 = rtf1.EMBEDOBJECT(1454, "", vFilePrim)
    Set eo2 = rtf1.EMBEDOBJECT(1454, "", vFileEvl)
    Set eo3 = rtf1.EMBEDOBJECT(1454, "", vFileExp)
    Set eo4 = rtf1.EMBEDOBJECT(1454, "", vFileP3)
    Set eo5 = rtf1.EMBEDOBJECT(1454, "", vFileSt)
   
    doc.Visible = True
    'Send Mail
    Call .Send(True)
MsgBox "An Email has been sent, Thank you.", vbInformation, "Confirmation"
DoCmd.Hourglass False

End With
'Deallocate Objects
Set rtf1 = Nothing
Set doc = Nothing
Set session = Nothing
DoCmd.Hourglass False
GoTo finished

Oops:
DoCmd.Hourglass False
MsgBox "Message Not Sent"

finished:
End Function

Any Suggestions?
~Tom
0
Comment
Question by:tagger418
10 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16971159
Do you get the same message even with the simplest of mails, no attachments, no body? Does it matter who creates/sends the mail, so if someone else uses the same code from a different PC?

What I don't get is that you see a message about "stored form". Is there a field called $Title in the Document Properties of the mail you received?
0
 
LVL 2

Author Comment

by:tagger418
ID: 16971246
I see both $Title and $Title_StoredForm

This is occur regardless of machine sent or received on as well as the Notes id used to send it.

If I only use the:

.Form = "Memo"
.SendTo = txt_EAdd

And comment out all other parts of the message I get the same results.

Thanks,
~tom
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16971265
Do you have a Memo-form in the database you send from? Does it have the property "Store form in documents" set?

As an alternative, comment out the line with
    .Form = "Memo"

Notes will use the default form (I hope)...
0
 
LVL 15

Expert Comment

by:mshogren
ID: 16971285
If you open the Memo form in Domino Designer, and look at the form properties, does the form have the Store Form with Document property?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 2

Author Comment

by:tagger418
ID: 16971332
Currently I am just running the code from the VBA editor.

If I comment out:  .Form = "Memo" the code cannot send the email.

unfortunately, I'm not a Notes Developer and I'm not really sure how to (or even if I can) open the memo form to check its properties.
0
 
LVL 2

Author Comment

by:tagger418
ID: 16971982
I Fixed It, NEVER MIND!!

.Form = "Default"
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16972306
That will achieve exactly the same. Notes has a form with the name Memo, but not a form with the name Default. The result is that the default form (=Memo) will be used to open the mail.

Glad it's solved!
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16973461
Just a quick observation and very glad that you resolved the problem, but    

Call .Send(True)  << the true means to attach the form, so if you  change that to call .send (false), I was wondering if you still get the errors?  


0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17141598
PAQed with points refunded (100)

CetusMOD
Community Support Moderator
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now