Unanswered: Can Outlook.Application .Body be split or .Attachments be manipulated inside it?
This isn't really a database question, but I'm trying to code an outlook mail object in my Access application VBA so I thought somebody here might know about that. Hope it's not too far off topic.
Anyway, I'm wondering if there's a way to do things with the .Attachments for an Outlook mailitem .Body when it is formatted as Rich Text, like reposition them some place other than the end of it. Would also like to add tabs or just spaces in between each attachment. It automatically puts .Attachments at the end of the .Body text with no space between them. Formatted as HTML, it just puts them in the attachments box near the subject of an email. Which doesn't work for me either.
Basically is there a way to split the .Body in two, put in the first part of the text, add the .Attachments, then put in the second part underneath?
Here is some code for what I'm doing:
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
Msg = "Some stuff"
.BodyFormat = olFormatRichText
'* ASCII CR & LF to put the attachments on the line after the end of the .Body
Msg = Msg & Chr(13) & Chr(10)
'* Get any attachments, these wind up at the end of .Body
Do While Not rs2.EOF
strDocName = rs2.Fields("TaskDocName")
strDocPath = rs2.Fields("TaskDocPath")
.Attachments.Add strDocPath, olByValue, , strDocName
.Body = Msg
.Subject = "Subject of some kind"
.To = "email@example.com"
'* display the email so it can be sent manually