
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to send mail by lotus notes
hi everyone,
i would like to send automatically an email by a Qlikwiew macro.
i'm using following instrunction tha doesent works:
Set nSess = CreateObject("Lotus.NotesSession")
any suggestion? i've already setted up the system acces on the security section.
here colpete script:
sub SendNotesMail_OCR_peggiori_1()
'Dim nSess As Object 'NotesSession
'Dim nDir As Object 'NotesDbDirectory
'Dim nDb As Object 'NotesDatabase
'Dim nDoc As Object 'NotesDocument
'Dim nAtt As Object 'NotesRichTextItem
'Dim vToList As Variant, vCCList As Variant, vBody As Variant
'Dim vbAtt As VbMsgBoxResult
'Dim sFilPath As String
'Dim sPwd As String
'************************************************************************** *****************
'LISTE INDIRIZZI
'************************************************************************** *****************
ReDim vToList(0)
vToList(0) = "f.cuniberto@arol.it"
'vToList(1) = ""
ReDim vCCList(0)
vCCList(0) = "f.cuniberto@arol.it"
'************************************************************************** *****************
'OGGETTO E CORPO
'************************************************************************** *****************
oggetto_mail = "Invio Report OCR Peggiori " & Date
corpo_mail = "Invio Automatico Lista OCR Peggiori"
'************************************************************************** *****************
'ALLEGATI
'************************************************************************** *****************
sFilPath1 = "J:\Scambio\Cuniberto\Monitor\OCR_peggiori.xls"
'sFilPath2 = ""
'sFilPath3 = ""
'************************************************************************** *****************
'To create notesession using COM objects, you can do so by using.
'either ProgID = Lotus.NotesSession
'or ClsID = {29131539-2EED-1069-BF5D-00DD011186B7}
'Replace ProgID by the commented string below.
'************************************************************************** *****************
Set nSess = CreateObject("Lotus.NotesSession") 'New:{29131539-2EED-1069-BF5D-00DD011186B7}
'************************************************************************** *****************
'This part initializes the session and creates a new mail document
'************************************************************************** *****************
'sPwd = Application.InputBox("Type your Lotus Notes password!", Type:=2)
sPwd = "kizivewo12"
Call nSess.Initialize(sPwd)
Set nDir = nSess.GetDbDirectory("")
Set nDb = nDir.OpenMailDatabase
Set nDoc = nDb.CreateDocument
'************************************************************************** *****************
'If you want to send it to multiple recipients then use variant array to get the names from
'the specified range as below
'Add / Remove Comment mark from vCCList as per your needs.
'************************************************************************** *****************
With nDoc
Set nAtt = .CreateRichTextItem("Body")
Call .ReplaceItemValue("Form", "Memo")
Call .ReplaceItemValue("Subject", oggetto_mail)
With nAtt
.AppendText (corpo_mail)
'Decide if you want to attach a file.
vbAtt = 6
Select Case vbAtt
Case 6
.AddNewLine
.AppendText ("********************************************************************")
.AddNewLine
Call .EmbedObject(1454, "", sFilPath1) '1454 = Constant for EMBED_ATTACHMENT
'Call .EmbedObject(1454, "", sFilPath2) '1454 = Constant for EMBED_ATTACHMENT
'Call .EmbedObject(1454, "", sFilPath3) '1454 = Constant for EMBED_ATTACHMENT
Case 7
'Do Nothing
End Select
End With
Call .ReplaceItemValue("CopyTo", vCCList)
Call .ReplaceItemValue("PostedDate", Now())
Call .Send(False, vToList)
End With
End sub

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is probably because your system doesn't have "Lotus.NotesSession"-type COM objects registered in Windows. As a result, it cannot create them.
You may need to install a Lotus Notes client or a Notes SDK on the machine where you want to run this macro.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry, but when i run this script in VBA Access it works correctly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On the same platform?
QlikView uses VBScript, not VBApplications. VBScript is a reduced version of VisualBasic, just for scripting purposes. The fact that it runs in MS-Access does not mean it will run in QlikView. Also, this macro is embedded in a QVW document that may travel to another platform (like a server) where Lotus Notes is an unknown quantity. There are many things to take into account.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VBA Access is running successful on the same machine as QlikView?
Further there some slight differences between VBA and VBS and maybe some of your statements have not the right syntax. For example I'm not sure that your call-statements within the with-statement is really valid (I never use them in this way).
- Marcus
