Hi,
Thanks to NateO I have been using the following code to Send XL data to Lotus Notes.
It works like a dream but the code as it stands just lists the data line by line in a single column.
I would like to mail the details of cells A1 to B3 in a proper format as follows:
Date 07/11/2005
Name Somebloke
Value £25,000.00
Im am a beginner in VB and have tried modifying this part of the code but have had no joy :
MailDoc.Body = _
Replace("The following NEW SUPPLIER request had been actioned today
@" _
& Join(Application.Transpose(Range([a1], [a300].End(3))), "@") _
& "@@...", "@", vbCrLf)
Any help would be very much appreciated.......Thanks.
Here is the original code :
Thanks to NateO I have been using the following code to Send XL data to Lotus Notes.
It works like a dream but the code as it stands just lists the data line by line in a single column.
I would like to mail the details of cells A1 to B3 in a proper format as follows:
Date 07/11/2005
Name Somebloke
Value £25,000.00
Im am a beginner in VB and have tried modifying this part of the code but have had no joy :
MailDoc.Body = _
Replace("The following NEW SUPPLIER request had been actioned today
& Join(Application.Transpose(Range([a1], [a300].End(3))), "@") _
& "@@...", "@", vbCrLf)
Any help would be very much appreciated.......Thanks.
Here is the original code :
Code:
Sub SendNotesMail()
Dim Maildb As Object, UserName As String, MailDbName As String
Dim MailDoc As Object, Session As Object
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 Maildb.IsOpen = True Then
Else: Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.SendTo = "Stuartluckhurst@ebgbakeries.co.uk" 'Nickname or full address
'MailDoc.CopyTo = Whomever
'MailDoc.BlindCopyTo = Whomever
MailDoc.Subject = "New Supplier Request notification"
MailDoc.Body = _
Replace("The following NEW SUPPLIER request had been actioned today:@@" _
& Join(Application.Transpose(Range([a1], [a300].End(3))), "@") _
& "@@...", "@", vbCrLf)
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now
On Error GoTo Audi
Call MailDoc.Send(False)
Set Maildb = Nothing: Set MailDoc = Nothing: Set Session = Nothing
Exit Sub
Audi:
Set Maildb = Nothing: Set MailDoc = Nothing: Set Session = Nothing
End Sub