View Single Post
  #11  
Old November 6th 08, 03:35 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

I didn't do the conversion from OLE_COLOR to RGB values but since black is
&H0 I'd imagine that 5 and 2 are just shades of black. Try setting the color
to something different like &HFF (or 255 which is red).

The message you're getting indicates from the applied test that RTFEditor is
either nothing or the editor type isn't RTF, that test really should be
before any attempts to use RTFEditor. What version of Outlook is this? Have
you tried using Item.GetInspector to set the SafeInspector.Item property
instead of using ActiveInspector?

--
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
...
Sorry, O forgot to add a piece of code [ TXT buton function ]
I put the RTFEditor function in a button, because I still didn't found the
right sentence to use it the [ Function Item_Open() ]

1) I didn't found the way to apply the policy modification to the body
task
2) the selected text became Bold and italic but stay black
3) I still get the message "This sample only works for the RTF Editor"



Sub TXT_click()

set sInspector = CreateObject("Redemption.SafeInspector")

sInspector.Item = Application.ActiveInspector

Set RTFEditor = sInspector.RTFEditor

RTFEditor.SelAttributes.Style.Bold = TRUE

RTFEditor.SelAttributes.Style.italic = TRUE

RTFEditor.SelAttributes.Color = 5

RTFEditor.SelAttributes.Color = 2

if (RTFEditor is Nothing) or (sInspector.EditorType olEditorRTF) Then

MsgBox "This sample only works for the RTF Editor" &vblf&
Item.GetInspector.EditorType

Else

RTFEditor.SelAttributes.Style.Bold = TRUE

End If

end sub


Ads