Emailing document automatically

M

Mark

I am using Office XP and Lotus Notes.

I am trying to email a document automatically. I have found the following
code:

________________________________________________________________
ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip

.Subject = "Test"
.AddRecipient "(e-mail address removed)"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce

End With

ActiveDocument.Route

________________________________________________________________

But when run it debugs with the following message:

"Your mail system does not support certain services needed for document
routing"

Does anyone know a work around or alternative how this can be achieved,
please?
 
D

Doug Robbins - Word MVP

The problem is with Lotus Notes. Try asking in a Lotus Notes newsgroup.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

Peter Jamieson

Someone posted some code in the microsoft.public.word.mailmergefields group
a while back that may help - try looking on Google Groups for

mailmerge to email using Lotus Notes or Eudora, no Outlook

(the message was posted on 18 Oct 2005)

Peter Jamieson
 
F

Frank

Hi Mark,

I needed this as well. I have created the following script that works for me:

Sub NotesAutoDocAttachSend_click()

Dim Session As Object, DB As Object, Memo As Object
Dim Server$, Mailfile$
Dim Item As Object, strSubject As String, strDest As String


strDest = "(e-mail address removed)"

strSubject = "Addressbook Load Form"
Set Session = CreateObject("Notes.NotesSession")

' Read the current mail server from Notes.ini
Server$ = Session.GETENVIRONMENTSTRING("MailServer", True)

' Read the current mail file from Notes.ini
Mailfile$ = Session.GETENVIRONMENTSTRING("MailFile", True)

' Try to open the mail database
Set DB = Session.GETDATABASE(Server$, Mailfile$)

' If Mail db not accessible, return an error
If Not DB.IsOpen Then
MsgBox "Could not access Notes mail file!"
Exit Sub
End If

'LN Message
'Create a memo in the user's mail file
Set Memo = DB.CREATEDOCUMENT


'Set the form to be a mail memo
Memo.Form = "Memo"
'Memo.copyto = "wherever"


'Set the from field (not necessary)
'Memo.From = Session.UserName


'Set the receipient of the memo
Memo.SendTo = strDest
'Give the memo a subject
Memo.Subject = strSubject


'Go to the body of the memo and embed the attachement
Set Item = Memo.CREATERICHTEXTITEM("Body")
If Len(ActiveDocument.Path) = 0 Then
MsgBox "Save the Document first!"
Exit Sub
Else
Call Item.EMBEDOBJECT(1454, "", ActiveDocument.FullName)
MsgBox "Document is e-mailed!!"
End If
'Send the memo
Call Memo.SEND(False, False)

End Sub

Good luck!

CHeers

Frank

"Mark" schreef:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top