Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Attaching excel in Loutus notes

I have a excel based form, upon completion, there is a button attached
"Submit", which will send email & attached that form to email. With Outlook
it is working fine. I need help for Lotus notes. Now, I have few user, who
uses
Lotus notes as email application. The version used by them is 6.5.2. I wrote
below macro, but not working, can someone help to fix this as well. What I
need is form with a custome button "submit" & upon cliking it should check
whether all required field is filled in & send send mail to "To" & "CC" with
that form as an attachment. Thanks in advance.

Sub lotus()
'
' lotus Macro
' Macro recorded 7/6/2005 by Abdulkader
'

' Dim objNotesSession As Object
Dim objNotesMailFile As Object
Dim objNotesDocument As Object
Dim objNotesField As Object


'Function SendMail()

On Error GoTo SendMailError

EmailSendTo = "
EmailCCTo = "

'Establish Connection to Notes
Set objNotesSession = CreateObject("Notes.NotesSession")

'Establish Connection to Mail File
' .GETDATABASE("SERVER","FILE")
Set objNotesMailFile = objNotesSession.GETDATABASE("", "")
'Open Mail
objNotesMailFile.OPENMAIL

'Create New Memo
Set objNotesDocument = objNotesMailFile.CREATEDOCUMENT

'Create 'Subject' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject",
EmailSubject)

'Create 'Send To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EmailSendTo)

'Create 'Copy To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EmailCCTo)

'Create 'Body' of memo
Set objNotesField = objNotesDocument.CREARERICHTEXTITEM("Body")

With objNotesField
.APPENDTEXT "Please find attached herewith the form duly filled in.
Looking forward toward receiving your quote. Thanks"
End With

'Attach the file --1454 indicate a file attachment
objNotesField = objNotesField.EMBEDOBJECT(1454, "", EmailSubject)
'objNotesField = objNotesField.EMBEDOBJECT(1454,"",ActiveWorkbook.F ullName)

'Send the e-mail
objNotesDocument.Send (0)

'Release storage
Set objNotesSession = Nothing
Set objNotesMailFile = Nothing
Set objNotesDocument = Nothing
Set objNotesField = Nothing

'Set return code
SendMail = True

'Exit Function

SendMailError:
Dim Msg
Msg = "Error#" & Str(Err.Number) & "was generated by" & Err.Source & Chr(13)
& Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext

SendMail = False


End Sub


--
Message posted via http://www.officekb.com
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attaching documents to Excel Xt Excel Worksheet Functions 1 November 21st 09 07:47 PM
Attaching an Excel File to an Email billbrandi Excel Discussion (Misc queries) 2 May 25th 09 01:22 PM
attaching Excel spreadsheet KimmyF Excel Discussion (Misc queries) 1 November 2nd 06 12:51 PM
attaching an image to Excel spreadsheet cell roadrunner Excel Worksheet Functions 2 October 19th 06 12:50 AM
Attaching Excel contacts to ACT! Bill Excel Discussion (Misc queries) 0 August 23rd 05 09:07 PM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"