Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-06-23
10
Medium Priority
?
1,405 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
9 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

877 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