Sending Email through Lotus Notes

786 views
Skip to first unread message

Harry

unread,
Apr 9, 2011, 11:06:56 PM4/9/11
to MS Excel Macro Vba
Hi Experts,
I am currectly working on a problem in VBA.

The idea is to create emails through VBA basis the data in the Excel
file and send them using Lotus Notes(save them as drafts in the user's
Lotus Notes ).

The main problem that I am facing is that the code creates the emails
with the text that I want them to contain, but these draft emails
donot contain Signature in it.

The code for creation of Draft emails was copied from the Net, and
tweaked to get the solution. The tweaking only confined to pouring in
data.

If somebody in the group has knowledge about this issue or has some
code that works out the following steps:
1) Create new email on the Lotus Notes application on the Users System
2) Has standard user Signature in it.
3) Containes the data that VBA puts in the email
4) The email is saved as drafts in the lotus notes

Thanks
Harry

Prashant Tripathi

unread,
Apr 11, 2011, 12:08:22 AM4/11/11
to exce...@googlegroups.com

Dear Harry,

 

Question

Customers with Microsoft® Visual Basic (VB) or VB.NET applications might want to integrate Lotus Notes® e-mail functionality. Is there an example of how to create a Notes® e-mail from Visual Basic?

Answer

The following Microsoft Visual Basic 6 (VB6) code sends a Notes e-mail message. It includes examples of code to include an attachment and to save the sent message, which are both optional and can be removed if desired.


Dim Maildb As Object
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
'Start a session to notes
Set Session = CreateObject("Lotus.NotesSession")
'This line prompts for password of current ID noted in Notes.INI
Call Session.Initialize 
'or use below to supply password of the current ID
'Call Session.Initialize("<password>")
'Open the mail database in notes
Set Maildb = Session.GETDATABASE("", "c:\notes\data\mail\mymail.nsf")
If Not Maildb.IsOpen = True Then
Call Maildb.Open
End If
'Create the mail document
Set MailDoc = Maildb.CREATEDOCUMENT
Call MailDoc.ReplaceItemValue("Form", "Memo")
'Set the recipient
Call MailDoc.ReplaceItemValue("SendTo", "John Doe")
'Set subject
Call MailDoc.ReplaceItemValue("Subject", "Subject Text")
'Create and set the Body content
Set Body = MailDoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT("Body text here")
'Example to create an attachment (optional)
Call Body.ADDNEWLINE(2)
Call Body.EMBEDOBJECT(1454, "", "C:\filename", "Attachment")
'Example to save the message (optional)
MailDoc.SAVEMESSAGEONSEND = True
'Send the document
'Gets the mail to appear in the Sent items folder
Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.SEND(False)
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing


Note: The Visual Basic programmer needs to set the Reference to use Lotus Domino® objects prior to implementing this function. To enable the Lotus Notes classes to appear in the Visual Basic browser, you must execute the following within VB: Select Tools, References and select the checkbox for 'Lotus Notes Automation Classes'.

 






--
You received this message because you are subscribed to the Google Groups "MS Excel Macro Vba" group.
To post to this group, send email to exce...@googlegroups.com.
To unsubscribe from this group, send email to excel_vba+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/excel_vba?hl=en.




--
prashant

IBM.Tools.Specialist k

unread,
Apr 11, 2011, 12:28:56 AM4/11/11
to MS Excel Macro Vba
Hello Hari.
Go through following,And let me know if you have further problem.


Using Microsoft Word or Excel to send Notes mail

You can use mail-enabled Microsoft® programs to work directly with
your IBM® Lotus Notes® mail on a Domino® server. For example, you can
use such applications as Microsoft Word or Excel to access Notes/
Domino mail and directory services.

To use mail-enabled Microsoft programs with Notes®, you first need to
set up a profile that lets you use the Notes Service Providers for the
Messaging Application Programming Interface (MAPI).

Note: Microsoft Outlook is also a mail-enabled application, and you
can use the procedure below to set it up for sending Notes mail, as
long as you are not already using IBM Lotus® Domino Access for
Microsoft Outlook.
To set up Notes MAPI Service Providers
Install Microsoft Office, including Microsoft Outlook, before
installing Notes. This is to ensure that MAPI components are installed
before you set up the Notes MAPI Service.
Note: If Notes is already installed before you install Microsoft
Office, uninstall Notes, install Microsoft Office, then reinstall
Notes.
Install Notes, if you have not done so, and set up Domino mail during
configuration.
In Notes, switch to a location from which you commonly send and
receive mail, or create a new location.
Click File > Location > Manage Locations, click Advanced > Locations,
click the current location, and then click Edit.
Click Advanced, type the file name of your User ID file in the User ID
to switch to field, and then click Save & Close.
Tip: To send messages in HTML format to Internet addresses without
format conversion, click the Mail tab and specify MIME format in the
Format for messages addressed to Internet addresses field.
In Microsoft Windows®, click Start > Control Panel or Start > Settings
> Control Panel.
Double-click the Mail or Mail and Fax icon. The icon is present only
when Microsoft Outlook is installed.
If necessary, click Show Profiles.
Click Add.
Select Lotus Notes Mail from the list and click Next.
For the profile name, type the name of the location you specified in
step 3. Match the name exactly, including case, and click OK.
Type the password for your user ID and click Next.
Click Finish.
Select the profile you created and click Properties.
Click the Addressing tab to view the address books for the profile. To
add a directory so you can look up mail recipients automatically when
sending messages using Word or Excel, click Add. If there is a Domino
directory that does not appear in the list on the Addressing tab,
select it in the Add dialog box and click OK.
Repeat the previous step for each Domino directory to access in Word
or Excel. Directories display in the Add dialog box list if they are
accessible from the home server listed in your current location
document.
Select a directory from the Show this address list first list, and
then click OK.
Note: You must select at least one Domino directory in the Addressing
options so Notes can check the names of recipients of your mail. Click
Tools > Options > Addressing to select a Domino directory if one has
not been selected automatically.
CAUTION:
Using a profile that includes both a Domino directory and a Microsoft
Exchange address book is not recommended.
To use Microsoft Word or Excel to send Notes mail
After you create the profile for the Notes Service Providers, you can
use the following procedure to send mail using Word or Excel.

In the mail-enabled product, click File > Send.
Select the profile you set up for the Lotus Notes Service Providers.
Create and send your message as you normally would.
Notes
If you are using a local Notes mail replica: After sending the mail
through the Microsoft application, start Notes, go to the Replication
and Sync page, click the Start Now button, and select Start Mail Only
Now. Notes then sends any mail stored in the outgoing mail box.
When you address messages, you can choose recipients from any
directory you specified in the profile you created. You can address
messages to individual recipients, distribution lists, and Notes
groups.
Related concepts
Mail
Related tasks
Using Microsoft Office Smart Tags with Lotus Notes


On Apr 11, 9:08 am, Prashant Tripathi <shyhac...@gmail.com> wrote:
> Dear Harry,
>
> *Question*
>
> Customers with Microsoft® Visual Basic (VB) or VB.NET applications might
> want to integrate Lotus Notes® e-mail functionality. Is there an example of
> how to create a Notes® e-mail from Visual Basic?
>
> *Answer*
>
> The following Microsoft Visual Basic 6 (VB6) code sends a Notes e-mail
> message. It includes examples of code to include an attachment and to save
> the sent message, which are both optional and can be removed if desired.
>
> *
> *
> *Note:* The Visual Basic programmer needs to set the Reference to use Lotus

IBM.Tools.Specialist k

unread,
Apr 11, 2011, 12:40:59 AM4/11/11
to MS Excel Macro Vba
**********Lotus Notes Email Signature*********

Subject: Lotus Notes 8 HTML Email Signature download
Feedback Type: Comment
Product Area: Announcement
Technical Area: New Features
Platform: ALL
Release: 8.0.2
Reproducible: Not applicable
 
Eos Solutions are an IBM Premier Business Partner in Australia and leading supporter of Lotus solutions. 

We have been offering a Lotus Notes email signature utility for free download from our website for two years.

Recently, our utility has been upgraded to Notes Domino version 8.0.2 and is available for free download from the worldwide Lotus community.

A lot of people have found this useful, and we hope we can help anyone who is looking for something like this. 

For more info, visit our webpage:
http://www.eos-solutions.com.au/wps/wcm/connect/w3eos/Website/NewsMedia/News/Free+Lotus+Notes+HTML+Email+Signature







Harry

unread,
Apr 12, 2011, 2:11:13 PM4/12/11
to MS Excel Macro Vba
Hi Guys,

Thanks for your inputs, but i think we lost the core question or may
be i dint understand the solutions provided completely.

Prashant: I dont know, can we use your code into Excel VBA?

IBM.Tools.Specialist: I dint understand a bit of what you wanted to
say, may be because my focus is on my problem, and i think all the
text that you provided was not related to it.

I assume that i was not clear in my question.

I will try to present my question again:

" I have a excel spreadsheet, which according to data and various
calculations on it finalises, how many emails are to be sent and to
whom.
Now i want to create a macro which picks up the following fields from
the excel spreadsheet for each email:
1) To:
2) CC:
3) Subject:
4) Body:

The emails are created in the users lotus notes and saved as
drafts(they are not sent to the receipients)"

Can somebody help me create one such macro. There are certain VBA
codes available on the net, but since i have limited knowledge in the
field of technology and VBA coding, i am unable to modify those codes.
It would be great if somebody could help me out with this Excel VBA
Problem"

IF you google "Sending emails through Lotus Notes" you would get some
sites that provide a VBA code, but if somebody can help me adopt it
throug a simple example.

Cheers
Harry

On Apr 11, 9:28 am, "IBM.Tools.Specialist k"
> > prashant- Hide quoted text -
>
> - Show quoted text -

rf1234 rf1234

unread,
Apr 13, 2011, 12:52:42 AM4/13/11
to exce...@googlegroups.com

Hello Harpreet,
We Can interrelate all ms office and .net Supported Application using Vba.

I am familiar with Lotus Notes for sending and receiving Mails Only. That’s

why I asked the help for some Lotus Notes Specialist.

Hope IBM.Tools.Specialist (Paulo) will help you, As soon as possible.

Regards,
Prashant Tripathi
Engineer-SW
Mobile: 0017202597567
Please consider the environment before printing.
----------------------------------------------------
Immer zielen auf die vollkommene Harmonie des
 Denkens & Wort & deed.Always zielen darauf ab,
 reinigen Sie Ihre Meinung und alles wird gut.
 ----------------------------------------------------
Always aim at complete harmony of thought &
 word & deed.Always aim at purifying your
thoughts & everything will be well.

Brigitte Bon..

unread,
Apr 18, 2011, 7:50:20 AM4/18/11
to exce...@googlegroups.com

Hello Harry,
Try the Lotus Notes Designer.
You can download it from here....

http://www.ibm.com/developerworks/downloads/ls/dominodesigner/index.html



On Tue, Apr 12, 2011 at 11:41 PM, Harry <harpree...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages