A
Anna
Hi :
I am outputting Access fields to Outlook email as a msgItem.HTMLBody. It is
a very long string. One of the fields (IncidentDescription) is of memo type
and when outputted it looses carrage returns. Is there any way that it could
look the same as it shows when it is inputted in Access. This causes some
problems as we are sending some formatting instructions for the signage
makers.
Some code:
Dim appOutlook As New Outlook.Application
Dim nsOutlook As NameSpace
Dim msFolder As MAPIFolder
Dim msgItem As MailItem
Dim myAttach As Attachments
Set nsOutlook = appOutlook.GetNamespace("MAPI")
'Set msFolder = nsOutlook.GetDefaultFolder(olFolderInbox)
Set msgItem = appOutlook.CreateItem(olMailItem)
Set myAttach = msgItem.Attachments
..
..
..
msgItem.Display
'
msgItem.To = " xxxx"
msgItem.Subject = "Work Order #: " & Me.[MyNumber] & "|Response: " &
Me.[DispatchMethod]
msgItem.HTMLBody = "<p><b><font size='4' face='Arial'
color='#666666'>Physical Resources Corrective Work Order # " &
Me.IncidentNumber & "</b></p>" & _
"<table width='100%' table border='0' id='AutoNumber1'>" & _
"<table width='100%' table border='0' id='AutoNumber2'>" & _
........
"<tr><td width='15%' height='25' align='right'><font face='Arial'
size='1'> Request Description:</font></td><td style='border-style: solid;
border-width: 1px; padding-left: 4px; padding-right: 4px'
bordercolor='#C0C0C0' height='25' width='85%'><font face='Arial' size='2'>" &
Me.IncidentDescription & "</font></td></tr></table>" & _
"<p> </p>" & _
"<table width='100%' table border='0' id='AutoNumber3'>" & _
"<tr><td width='100%' colspan='2' style = 'border-top: 3px solid
#666666'><font face='Arial' size='1'> </font></td></tr></table>" & _
"<p><b><font size='4' face='Arial' color='#666666'>Work Completion
Report</b></p>" & _
....................
"<tr><td width='15%' height='25' align='right'><font face='Arial'
size='1'> Comments:</font></td><td style='border-style: solid; border-width:
1px; padding-left: 4px; padding-right: 4px' bordercolor='#C0C0C0' height='25'
width='85%'><font face='Arial' size='2'>" & Me.IncidentDescription &
"</font></td></tr></table>" & _
End Sub
Can you help?
I am outputting Access fields to Outlook email as a msgItem.HTMLBody. It is
a very long string. One of the fields (IncidentDescription) is of memo type
and when outputted it looses carrage returns. Is there any way that it could
look the same as it shows when it is inputted in Access. This causes some
problems as we are sending some formatting instructions for the signage
makers.
Some code:
Dim appOutlook As New Outlook.Application
Dim nsOutlook As NameSpace
Dim msFolder As MAPIFolder
Dim msgItem As MailItem
Dim myAttach As Attachments
Set nsOutlook = appOutlook.GetNamespace("MAPI")
'Set msFolder = nsOutlook.GetDefaultFolder(olFolderInbox)
Set msgItem = appOutlook.CreateItem(olMailItem)
Set myAttach = msgItem.Attachments
..
..
..
msgItem.Display
'
msgItem.To = " xxxx"
msgItem.Subject = "Work Order #: " & Me.[MyNumber] & "|Response: " &
Me.[DispatchMethod]
msgItem.HTMLBody = "<p><b><font size='4' face='Arial'
color='#666666'>Physical Resources Corrective Work Order # " &
Me.IncidentNumber & "</b></p>" & _
"<table width='100%' table border='0' id='AutoNumber1'>" & _
"<table width='100%' table border='0' id='AutoNumber2'>" & _
........
"<tr><td width='15%' height='25' align='right'><font face='Arial'
size='1'> Request Description:</font></td><td style='border-style: solid;
border-width: 1px; padding-left: 4px; padding-right: 4px'
bordercolor='#C0C0C0' height='25' width='85%'><font face='Arial' size='2'>" &
Me.IncidentDescription & "</font></td></tr></table>" & _
"<p> </p>" & _
"<table width='100%' table border='0' id='AutoNumber3'>" & _
"<tr><td width='100%' colspan='2' style = 'border-top: 3px solid
#666666'><font face='Arial' size='1'> </font></td></tr></table>" & _
"<p><b><font size='4' face='Arial' color='#666666'>Work Completion
Report</b></p>" & _
....................
"<tr><td width='15%' height='25' align='right'><font face='Arial'
size='1'> Comments:</font></td><td style='border-style: solid; border-width:
1px; padding-left: 4px; padding-right: 4px' bordercolor='#C0C0C0' height='25'
width='85%'><font face='Arial' size='2'>" & Me.IncidentDescription &
"</font></td></tr></table>" & _
End Sub
Can you help?