Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-06-23
10
Medium Priority
?
1,403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

  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…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

670 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