Maybe this is a little bit off-topic because it's about Word & VBA and not Excel & VBA but I found that it fits best in this category...
I'm having a word document which can be sent to Outlook automatically. This is done by creating a new Outlook message (specified: outlook invitation) and then attaching the (temporary saved) doc-file as attachment to the message. It's all done with vba and looks like this:
Private Sub einladungErstellen()
Dim objOL 'As Outlook.Application
Dim objAppt 'As Outlook.AppointmentItem
Dim attPath As String
Const olAppointmentItem = 1
Const olMeeting = 1
attPath = Tempfile
Set objOL = CreateObject("Outlook.Application")
Set objAppt = objOL.CreateItem(olAppointmentItem)
.Subject = Title
.Start = Startdate
.End = Enddate
.Location = RoomName
.MeetingStatus = olMeeting ' make it a meeting request
.Body = "This is a test-text in the message body..."
Set objAppt = Nothing
Set objOL = Nothing
When I run the code, everything is working well and without any problems. But I would like to paste the formatted content of the word file directly to the message body. At the moment, I only know how to send unformatted text to the message body:
objAppt.Body = "This is my text"
How can I send formatted text as body content?
=> Maybe one could do this with a complete different approach: It's possible to copy the worddocument-content to clipboard and then paste it manually in the generated outlook message with 'ctrl+v'. Would it be possible to automate this?