Solved

Word macro to send an email to a mailbox on the mail server

Posted on 2004-10-12
4
213 Views
Last Modified: 2013-12-18
We are using Lotus Notes R5. We receive our pay slips in a single Word document.  I have been tasked with simplifying the distribution of the payslips to th individual employees.  I have written a Word macro which seperates th slips into individual Word documents and the documets are saved as the the employee's short-email-address.doc (ex JohnS.doc) .  The files ase saved on the mail server.  How can I best have an agent send these payslips to the individual recipients?  

For example, would it be possible for the Word macro to send an email to a mailbox on the mail server which would trigger the agent to run when the email arrives?
All suggestions will be appreciated.
0
Comment
Question by:witgrefe
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 25 total points
ID: 12290676
Better to have the Word macro just send teh payslips directly, rather than depositing them on the server and then having an agent do them.  Here's a simple function in VBA to do this:

Sub SendSlip ( notesSession , shortName As String , attachmentFilePath As String)
    Set dbDir = notesSession.getDbDirectory()
    Set myMail = dbDir.openMailFile()
    Set msg = myMail.CreateDocument()
    msg.replaceItemValue "Form" , "Memo"
    msg.replaceItemValue "SendTo" , shortName
    msg.replaceItemValue "Subject" , "Pay stub enclosed"
    Set body = msg.createRichTextItem("Body")
    body.embedObject 1454 , "" , attachmentFilePath
    msg.send False
End Sub

Just pass it a notesSession onject, the short name string, and a string containing teh full path name of the file.

How to create a NotesSession?  Attach the TLB from the Notes directory to your VBA project, then...

Dim s as New Lotus.NotesSession
s.Initialize("your Notes password")

You can now pass --> s <-- as the first parameter.
0
 

Author Comment

by:witgrefe
ID: 12298131
Hello Qwaletee,

I presume you mean the notes32.tlb, but I not sure that I know how to attach it to the macro.  The macro is in a .dot template.  Does that make any difference?

Regards
0
 
LVL 1

Assisted Solution

by:yangshuhua
yangshuhua earned 25 total points
ID: 12339908
It's domobj.tlb. in Lotus Notes data  folder on your local computer.

Sherry

0
 

Author Comment

by:witgrefe
ID: 12361186
Thanks Sherry,

my problem is that I do not know how to 'attach' it.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Migration: Lotus Notes to Exchange 2013 10 328
Only send email if contains "abcd" 3 147
how to install domino server on suse linux 18 81
Lotus Notes Mailbox (Mail Forwarding) 9 49
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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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