Sheet Range Through Lotus Notes - Nate O.?

stapuff

Well-known Member
Joined
Feb 19, 2004
Messages
1,126
The following code provided by Nate O. & Van Pookie (thank you by the way) works great, however, I need help on making a change. This sends all values in column b to an e-mail Lotus Notes format. How can it change it to send all values in a range A1:D65536.end :pray:

Dim Maildb As Object, UserName As String, MailDbName As String
Dim MailDoc As Object, Session As Object
Dim myStr As Variant
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, _
(Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GetDatabase("", MailDbName)
If Not Maildb.IsOpen Then Maildb.OpenMail
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.SendTo = "homer@simpson.com" 'Nickname or full address
'MailDoc.CopyTo = Whomever
'MailDoc.BlindCopyTo = Whomever
MailDoc.Subject = "Help Me"
With Range([B5], [B65536].End(3))
If IsArray(.Value) Then Let myStr = _
Join(WorksheetFunction.Transpose(.Value), "@") _
Else Let myStr = .Value
End With
MailDoc.Body = WorksheetFunction.Substitute( _
"Good afternoon!@@The following EO's are being sent to you:@@" _
& myStr & "@@Thank you and have a great weekend!", "@", vbCrLf)
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now
Call MailDoc.Send(False)
Set Maildb = Nothing: Set MailDoc = Nothing: Set Session = Nothing
End Sub



Thanks,


Kurt
 
Nate -

I seen posts where people refer to you as the "best" or a "god" - I can not come up with anything better than that. However, I will bow down to the code knowing that hundreds of manhours a year will be saved (or spent elsewhere). Code works perfectly.

I appreciate everything you have done for me. Sometimes hand holding is OK.

Thanks Nate,

Kurt
 
Upvote 0
You're too kind Kurt. There are many talented members here.

Glad to be of help and best with your Excel endeavours. :)
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top