Excel Send Email Using Lotus Notes 8

physco827

New Member
Joined
Jul 23, 2010
Messages
3
The code below sends out an e-mail through microsoft excel using lotus notes 8 but it does not keep the text formatted. For instance there are headings in the text that i want to be bold but it doesn't keep the bold formatting. I have tried a couple of things but it seems a lot of the things (like htmlbody instead of body) only seem to work with Lotus Notes 7 and not 8. Any help would be greatly appreciated. Or if there is another way to make a form in excel and then have it get sent out (in the correct format) through lotus notes 8, I would like to know.

Lots of googling has lead me to this site because I can't seem to figure it out and neither can anyone (it seems) at my company.

Thanks


Code:
Sub Picture5_Click()

Dim noSession As Object, noDatabase As Object, noDocument As Object
Dim obAttachment As Object, EmbedObject As Object
Dim stSubject As Variant, stAttachment As String
Dim vaRecipient As Variant, vaMsg As Variant, vaSubject As Variant, vaCopyTo As Variant

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
Set noDocument = noDatabase.CreateDocument

'vaRecipient = Worksheets("Sheet1").Range("D11")
vaRecipient = Split(Range("D11").Value, ",")
vaCopyTo = Split(Range("D16").Value, ",")

vaSubject = Worksheets("Sheet1").Range("D21")
'What was the problem reading

vaMsg = Worksheets("Sheet1").Range("C23") & vbCrLf & Worksheets("Sheet1").Range("C277") & Worksheets("Sheet1").Range("C24")

'Where did the outage.... reading
vaMsg = vaMsg & vbCrLf & vbCrLf & vbCrLf & Worksheets("Sheet1").Range("C31") & vbCrLf & Worksheets("Sheet1").Range("C277") & Worksheets("Sheet1").Range("C32")

'Who was impacted.... reading
vaMsg = vaMsg & vbCrLf & vbCrLf & vbCrLf & Worksheets("Sheet1").Range("C39") & vbCrLf & Worksheets("Sheet1").Range("C277") & Worksheets("Sheet1").Range("C40")

'When did the outage / incident occur.... reading
vaMsg = vaMsg & vbCrLf & vbCrLf & vbCrLf & Worksheets("Sheet1").Range("C47") & vbCrLf & Worksheets("Sheet1").Range("C277") & Worksheets("Sheet1").Range("C48")

'resolution.... reading
vaMsg = vaMsg & vbCrLf & vbCrLf & vbCrLf & Worksheets("Sheet1").Range("C50") & vbCrLf & Worksheets("Sheet1").Range("C277") & Worksheets("Sheet1").Range("C51")

'next steps.... reading
vaMsg = vaMsg & vbCrLf & vbCrLf & vbCrLf & Worksheets("Sheet1").Range("C58") & vbCrLf & Worksheets("Sheet1").Range("C277") & Worksheets("Sheet1").Range("C59")

noDocument.SendTo = vaRecipient

noDocument.CopyTo = vaCopyTo
noDocument.Form = "Memo"
noDocument.SendTo = vaRecipient
noDocument.CopyTo = vaCopyTo
noDocument.Subject = vaSubject
noDocument.body = vaMsg
noDocument.SaveMessageOnSend = True

With noDocument
.PostedDate = Now()
.SEND 0, vaRecipient
End With

Set EmbedObject = Nothing
Set obAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing

'Activate Excel for the user.
AppActivate "Microsoft Excel"
MsgBox "The e-mail has successfully been created and distributed.", vbInformation

End Sub
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,214,385
Messages
6,119,208
Members
448,874
Latest member
b1step2far

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