Solved

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

Posted on 2006-06-23
10
1,386 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus Notes Mail Database issues 2 898
names.nsf ODS upgrade 4 423
Lotus Notes Calendar Help 6 98
Lotus Notes Mailbox (Mail Forwarding) 9 40
For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

18 Experts available now in Live!

Get 1:1 Help Now