When I try to display a Task Item with the associated inspector,
I also want to add some text. That's Ok. The problem
is however, to f o r m a t the text in the body so that I can
have a header with bold font and say, font size 16 and the rest
of the text Arial, font size 12. How do I do this ?
Can somebody please show me some code example that does this?
Any help will be very much appriciated - thanks in advance.
Regards Jan
------------------------------------------
The code below is in an Excel workbook.
------------------------------------------
Sub Intervju_Appointment()
Dim MyOlApp As Object
Dim MyItem As Object
'Dim MyAttachments As Attachments
Set MyOlApp = CreateObject("Outlook.Application")
Set MyItem = MyOlApp.CreateItem(olAppointmentItem)
MyItem.Subject = "Intervju - vedr. stilling som xxx"
MyItem.Body = "This should be the header; Bold Font size 16" _
& vbCrLf & vbCrLf _
& "Click teh icon to open the Sales Results." & Chr(13)
'Set MyAttachments = MyItem.Attachments
'MyAttachments.Add "C:\Mine dokumenter\Hei.doc", olByValue, 1, _
"Prøvedokument"
MyItem.Display
End Sub
(PS : The code is slightly modified. It is taken from the book
Building Applications with Outlook2ooo. I' m also having
problem with the attachments - code, wich generates an error ?)
--
Sue Mosher, Outlook MVP
Author of
Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
Microsoft Outlook 2000 E-mail and Fax Guide
Outlook and Exchange solutions at http://www.slipstick.com
"Jan G. Thorstensen" <jgth...@online.no> wrote in message
news:%oSb6.527$jQ1....@news1.oke.nextra.no...
Jan
-----------------
Sue Mosher [MVP] <sue...@slipstick.com> skrev i
meldingsnyheter:uTtZibthAHA.1728@tkmsftngp02...
Sue Mosher at Slipstick.com posted a very helpful link on another group:
http://www.slipstick.com/dev/formatmsg.htm
What the info there tells you, though, is that you need to get a special dll
called mapirtf.dll, which provides a method (writertf) that writes a string of
rich text out to a message, once it exists. So you have to create the message,
get its ID and close it; somehow get your body in Rich Text (in Word, you can
save in Rich Text than read back in from code as text; or you can copy to the
clipboard and use more API calls to read the RTF back in); then call writertf.
Another wrinkle: so far I haven't gotten this to work for a message created with
the Outlook object model. I had to use CDO to create the message instead, which
is a whole other object model, and takes longer because it establishes a separate
MAPI stream. The messages appear identical, but writertf fails on the Outlook
one.
Sue was thinking of posting a sample of what I've accomplished so far; not sure
if she has. If you want more, email me directly at ul...@home.com; I don't
monitor this group very often.
Cheers... Perry.
Regards Jan
.