View Single Post
  #13  
Old November 7th 08, 03:08 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to programaticaly use Bold or Colored Text in Task Body

You have to add what you want added using correct RTF formatting or else
you're rewriting the body as do add the new text. Add what you want using
RTFEditor.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"bbnimda" wrote in message
...
Hello Ken

Here is my working code , If I do nothing else my formated text is kept
=================================
Function Item_Open()
Set myFolder = Application.ActiveExplorer.CurrentFolder
Id = myfolder.items.count
CurUsr = application.GetNameSpace("MAPI").CurrentUser
If Item.LastModificationTime #1/1/4501# Then
NewTask = 0
Long0 = 0
else
NewTask = 1
Long0 = len(body)
end if
If Not (Application.ActiveInspector Is Nothing) Then
Set sInspector = CreateObject("Redemption.SafeInspector")
sInspector.Item = Application.ActiveInspector
Set RTFEd = sInspector.rtfeditor
If Not (RTFEd Is Nothing) Then
Set RTA = RTFEd.SelAttributes
RTFEd.SelStart = intStart + longueur
RTA.Style.Bold = True
RTA.Style.italic = true
RTA.Color = 9709060
if long0 0 then
sInspector.SelText = " " & vbLf & vbLf & vbLf & CurUsr &
" le "& date()& vbCrLf
else
sInspector.SelText = CurUsr & " "& date()& vbCrLf
end if
RTA.Style.Bold = false
RTA.Style.italic = false
RTA.Color = 1
end if
end if
End Function
=================================

but if I add something like
body = body & vblf&"closed " for example closed is added at the end of
my task body and all the task body text (include the text in bold or
colored) became simple text and black

tks for your help


Ads