Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default lotus notes email

Hi,
I use Lotus Notes as email and have set up a macro in Excel using the
information from XL-Dennis on VSTO /.Net & Excel to create my email macro and
have finally got the macro to work without getting an error message. The
problem that I have is that when I click the button to email the form, I
receive a message stating that the email has been sent, but I have not
designated an email address for the email to go to. I would like to choose
the email address each time before I email the form.

Can someone please provide me with the exact language to include in my macro
that would allow me to do so. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default lotus notes email

pdaws wrote...
....
Can someone please provide me with the exact language to include in my macro
that would allow me to do so. *Thanks.


No, not without seeing the code you're using or knowing the Lotus
Notes object model, which I'd guess most Excel users don't know.

A guess: you need to add code to your macro that checks whether the e-
mail recipient field/property is empty, and if it is, the macro either
prompts you to enter the recipient's e-mail address which the macro
then incorporates into the e-mail and sends it or aborts with a
message telling you you need to provide the recipient's e-mail
address.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default lotus notes email

Harlan,

Below is the code that I am using. I am not sure how to proceed from here.
Hopefully this helps and yes you are right, I do not know what Notes object
model I am using. Thanks.

Const EMBED_ATTACHMENT As Long = 1454

Const stPath As String = "c:\Temp"

Const stSubject As String = "American Express Request Form Approval Required"

Const vaMsg As Variant = "Please OPEN this AMEX Request." & vbCrLf & _
"And click your APPROVAL link on the bottom of the
form, and click SAVE," & vbCrLf & _
"Then email this AMEX Request to the next Approver"

Dim stFileName As String
Dim vaRecipients As Variant

Dim noSession As Object
Dim noDatabase As Object
Dim noDocument As Object
Dim noEmbedObject As Object
Dim noAttachment As Object
Dim stAttachment As String

'Variables for E-mailaddress.
Dim vaMailTo As Variant
Dim vaCopyTo As Variant
Dim vaBCC As Variant

'Copy the active sheet to a new temporarily workbook.
With ActiveSheet
.Copy
'Populate the variant variables with mailaddress.
vaMailTo = .Range("A2:A4").Value
vaCopyTo = .Range("B2:B4").Value
vaBCC = .Range("C2:C4").Value
stFileName = .Name
End With

'Create the full path and name of the workbook.
stAttachment = stPath & "\" & stFileName & ".xls"

'Save and close the temporarily workbook.
With ActiveWorkbook
.SaveAs stAttachment
.Close
End With

'Create the list of recipients.
vaRecipients = ")

'Instantiate the Lotus Notes COM's Objects.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")

'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL

'Create the e-mail and the attachment.
Set noDocument = noDatabase.CreateDocument
Set noAttachment = noDocument.CreateRichTextItem("stAttachment")
Set noEmbedObject = noAttachment.EmbedObject(EMBED_ATTACHMENT, "",
stAttachment)

'Add values to the created e-mail main properties.
With noDocument
.Form = "Memo"
.SendTo = vaRecipients
.CopyTo = vaCopyTo
.Subject = stSubject
.Body = vaMsg
.SaveMessageOnSend = True
.PostedDate = Now()
.Send 0, vaRecipients
End With

'Delete the temporarily workbook.
Kill stAttachment

'Release objects from memory.
Set noEmbedObject = Nothing
Set noAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing

MsgBox "This AMEX Request Form e-mail has successfully been created and
distributed", vbInformation

End Sub

"pdaws" wrote:

Hi,
I use Lotus Notes as email and have set up a macro in Excel using the
information from XL-Dennis on VSTO /.Net & Excel to create my email macro and
have finally got the macro to work without getting an error message. The
problem that I have is that when I click the button to email the form, I
receive a message stating that the email has been sent, but I have not
designated an email address for the email to go to. I would like to choose
the email address each time before I email the form.

Can someone please provide me with the exact language to include in my macro
that would allow me to do so. Thanks.

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
Attach File to a Lotus Notes new email Kevin Excel Discussion (Misc queries) 2 January 5th 08 01:23 AM
?? Email Excel sheet thru Lotus Notes Jaylin Excel Discussion (Misc queries) 1 October 16th 07 05:12 PM
??email excel sheet w Lotus notes Jaylin Excel Discussion (Misc queries) 3 October 12th 07 03:40 PM
Sending An Email To Web-Based Lotus Notes 7 SEAN DI''''ANNO Excel Discussion (Misc queries) 0 June 7th 07 10:16 AM
Why won't AOL email communicate with lotus notes email? ManInaMaze Excel Discussion (Misc queries) 0 August 3rd 05 02:41 AM


All times are GMT +1. The time now is 12:18 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"