N
nathan_savidge
Hi,
I am posting this in Outlook programming, as i am not sure where to put it.
I have an access database that sends an email based on users diary's each
monday. This works fine, however, it is a little messy on the email.
I would like to add a table to present the information in. No borders, no
shading, just to allign everything nicely.
This is the code that i currently have.
Sub send_email(strRecipient As String, strSubject As String, strBody As
String, Optional strAttPath As String)
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = strRecipient
.Subject = strSubject
.Body = strBody
.Send
If (strAttPath) <> "" Then .Attachments.Add strAttPath
End With
Set appOutLook = Nothing
Set MailOutLook = Nothing
End Sub
strRecipient is populated from a recordset based on the diary table and the
variable strSubjet is created in another module, like
While Not (rst2.EOF)
strEmailBody = strEmailBody & _
.Fields("tbl_Policy_Details.Name").Value &
vbTab & vbTab & _
.Fields("Delay_Reason").Value & vbTab & _
.Fields("Date_Created").Value &
vbTab & _
.Fields("F_D").Value & vbCrLf
.MoveNext
Wend
the vbtab works ok, but on long staff names, it throws the formatting out.
Thanks in advance.
Nathan.
I am posting this in Outlook programming, as i am not sure where to put it.
I have an access database that sends an email based on users diary's each
monday. This works fine, however, it is a little messy on the email.
I would like to add a table to present the information in. No borders, no
shading, just to allign everything nicely.
This is the code that i currently have.
Sub send_email(strRecipient As String, strSubject As String, strBody As
String, Optional strAttPath As String)
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = strRecipient
.Subject = strSubject
.Body = strBody
.Send
If (strAttPath) <> "" Then .Attachments.Add strAttPath
End With
Set appOutLook = Nothing
Set MailOutLook = Nothing
End Sub
strRecipient is populated from a recordset based on the diary table and the
variable strSubjet is created in another module, like
While Not (rst2.EOF)
strEmailBody = strEmailBody & _
.Fields("tbl_Policy_Details.Name").Value &
vbTab & vbTab & _
.Fields("Delay_Reason").Value & vbTab & _
.Fields("Date_Created").Value &
vbTab & _
.Fields("F_D").Value & vbCrLf
.MoveNext
Wend
the vbtab works ok, but on long staff names, it throws the formatting out.
Thanks in advance.
Nathan.