A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to programaticaly use Bold or Colored Text in Task Body



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 3rd 08, 03:54 PM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default How to programaticaly use Bold or Colored Text in Task Body

Hi all,

I made a custom form "Task" and each time some one open the task I add at
the en of the Task body the time and the name of the curent user


I wanted to hihg light the Tag by making the the text Bold and colored
(one different color for each user)

Here is a part of my code
Function Item_Open()

Set FormPage = Item.GetInspector.ModifiedFormPages("MyForm")

CurUsr = application.GetNameSpace("MAPI").CurrentUser

body = body & CurUsr & " le " & date & chr(13) = I want to make this line
Bold and Colored

....
....
end function


how can I do That


Ads
  #2  
Old November 4th 08, 10:43 PM posted to microsoft.public.outlook.program_forms
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to programaticaly use Bold or Colored Text in Task Body

Can't do that using the Outlook Object Model alone.
plug
You can use SafeInspector.RtfEditor in Redemption -
http://www.dimastr.com/redemption/safeinspector.htm
/plug

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"bbnimda" wrote in message
...
Hi all,

I made a custom form "Task" and each time some one open the task I add at
the en of the Task body the time and the name of the curent user


I wanted to hihg light the Tag by making the the text Bold and colored
(one different color for each user)

Here is a part of my code
Function Item_Open()

Set FormPage = Item.GetInspector.ModifiedFormPages("MyForm")

CurUsr = application.GetNameSpace("MAPI").CurrentUser

body = body & CurUsr & " le " & date & chr(13) = I want to make this
line Bold and Colored

...
...
end function


how can I do That



  #3  
Old November 5th 08, 02:35 PM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default How to programaticaly use Bold or Colored Text in Task Body

Hello Dimitry

I tryed but I got a message "This sample only works for the RTF Editor"
what's wrong ?

tks


"Dmitry Streblechenko" a écrit dans le message de news:
...
Can't do that using the Outlook Object Model alone.
plug
You can use SafeInspector.RtfEditor in Redemption -
http://www.dimastr.com/redemption/safeinspector.htm
/plug

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"bbnimda" wrote in message
...
Hi all,

I made a custom form "Task" and each time some one open the task I add at
the en of the Task body the time and the name of the curent user


I wanted to hihg light the Tag by making the the text Bold and colored
(one different color for each user)

Here is a part of my code
Function Item_Open()

Set FormPage = Item.GetInspector.ModifiedFormPages("MyForm")

CurUsr = application.GetNameSpace("MAPI").CurrentUser

body = body & CurUsr & " le " & date & chr(13) = I want to make this
line Bold and Colored

...
...
end function


how can I do That





  #4  
Old November 5th 08, 04:02 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

What code did you try? Did you instantiate an RTFEditor object and use that?
Is the item you tested on actually an RTF item?

--
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 Dimitry

I tryed but I got a message "This sample only works for the RTF Editor"
what's wrong ?

tks


  #5  
Old November 5th 08, 04:16 PM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default How to programaticaly use Bold or Colored Text in Task Body

I did nothing else than openning a new task and customise it and add script
to and some function
I saved my form and populate it in Public Folder (Excahnge 2003)

Q1: How can I set an RTF item
Q2: My form is in the "Public Folder" the RTF format will be available for
every user ?

tks

"Ken Slovak - [MVP - Outlook]" a écrit dans le message
de news: ...
What code did you try? Did you instantiate an RTFEditor object and use
that? Is the item you tested on actually an RTF item?

--
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 Dimitry

I tryed but I got a message "This sample only works for the RTF Editor"
what's wrong ?

tks




  #6  
Old November 5th 08, 04:28 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

A task item will have an RTF body. So what code did you use that gave you
the error? You didn't answer my question.

--
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
...
I did nothing else than openning a new task and customise it and add
script to and some function
I saved my form and populate it in Public Folder (Excahnge 2003)

Q1: How can I set an RTF item
Q2: My form is in the "Public Folder" the RTF format will be available for
every user ?

tks


  #7  
Old November 5th 08, 05:09 PM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default How to programaticaly use Bold or Colored Text in Task Body

Dim CurUsr,YesNo,2Send,2Save,StampColor

Function Item_Open()
Set FormPage = Item.GetInspector.ModifiedFormPages("Tasks_ON")
Set Control = FormPage.Controls("ComboBox6")
Control.PossibleValues = "Normale;Haute"

CurUsr = application.GetNameSpace("MAPI").CurrentUser
Select case CurUsr
case "User1"
StampColor = 1

case "UserX"
StampColor = 1
end select
if len(body) = 0 then
body = & CurUsr & " " & date & chr(13)
else body = body & chr(13) & chr(13) & CurUsr & " " & date & chr(13)
end if


"Ken Slovak - [MVP - Outlook]" a écrit dans le message
de news: ...
A task item will have an RTF body. So what code did you use that gave you
the error? You didn't answer my question.

--
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
...
I did nothing else than openning a new task and customise it and add
script to and some function
I saved my form and populate it in Public Folder (Excahnge 2003)

Q1: How can I set an RTF item
Q2: My form is in the "Public Folder" the RTF format will be available
for every user ?

tks




  #8  
Old November 5th 08, 05:19 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

That code doesn't use RTFEditor at all or even use Redemption at all. You
said the Redemption sample didn't work. So at this point I have no idea what
you're talking about.

If you want to change the format of the text you need to use Redemption
code, the RTFEditor object and format you're text correctly for RTF
formatting.

--
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
...
Dim CurUsr,YesNo,2Send,2Save,StampColor

Function Item_Open()
Set FormPage = Item.GetInspector.ModifiedFormPages("Tasks_ON")
Set Control = FormPage.Controls("ComboBox6")
Control.PossibleValues = "Normale;Haute"

CurUsr = application.GetNameSpace("MAPI").CurrentUser
Select case CurUsr
case "User1"
StampColor = 1

case "UserX"
StampColor = 1
end select
if len(body) = 0 then
body = & CurUsr & " " & date & chr(13)
else body = body & chr(13) & chr(13) & CurUsr & " " & date & chr(13)
end if


  #9  
Old November 6th 08, 09:18 AM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default How to programaticaly use Bold or Colored Text in Task Body

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





"Ken Slovak - [MVP - Outlook]" a écrit dans le message
de news: ...
That code doesn't use RTFEditor at all or even use Redemption at all. You
said the Redemption sample didn't work. So at this point I have no idea
what you're talking about.

If you want to change the format of the text you need to use Redemption
code, the RTFEditor object and format you're text correctly for RTF
formatting.

--
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
...
Dim CurUsr,YesNo,2Send,2Save,StampColor

Function Item_Open()
Set FormPage = Item.GetInspector.ModifiedFormPages("Tasks_ON")
Set Control = FormPage.Controls("ComboBox6")
Control.PossibleValues = "Normale;Haute"

CurUsr = application.GetNameSpace("MAPI").CurrentUser
Select case CurUsr
case "User1"
StampColor = 1

case "UserX"
StampColor = 1
end select
if len(body) = 0 then
body = & CurUsr & " " & date & chr(13)
else body = body & chr(13) & chr(13) & CurUsr & " " & date & chr(13)
end if




  #10  
Old November 6th 08, 03:26 PM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default [Found] How to programaticaly use Bold or Colored Text in Task Body

In fact my script was righ the only mistake I made is that at the end of
initialisation I added something like

"........
Body = Body & vblf
.......
"

at this point all my formated body Text (Bold / Color) became black and
standard (no bold or italic effect)

"bbnimda" a écrit dans le message de news:
...
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





"Ken Slovak - [MVP - Outlook]" a écrit dans le
message de news: ...
That code doesn't use RTFEditor at all or even use Redemption at all. You
said the Redemption sample didn't work. So at this point I have no idea
what you're talking about.

If you want to change the format of the text you need to use Redemption
code, the RTFEditor object and format you're text correctly for RTF
formatting.

--
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
...
Dim CurUsr,YesNo,2Send,2Save,StampColor

Function Item_Open()
Set FormPage = Item.GetInspector.ModifiedFormPages("Tasks_ON")
Set Control = FormPage.Controls("ComboBox6")
Control.PossibleValues = "Normale;Haute"

CurUsr = application.GetNameSpace("MAPI").CurrentUser
Select case CurUsr
case "User1"
StampColor = 1

case "UserX"
StampColor = 1
end select
if len(body) = 0 then
body = & CurUsr & " " & date & chr(13)
else body = body & chr(13) & chr(13) & CurUsr & " " & date & chr(13)
end if






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar task pad dates not bold Alex Hawkins Outlook - Calandaring 9 January 21st 08 12:08 PM
body text always in bold martin shaw Outlook - General Queries 4 December 29th 07 08:54 AM
Calendar Bold Text Silver Outlook - Calandaring 1 January 8th 07 01:11 PM
Outlk 2k3 script: Tab in body Task "space to separate text" news.microsoft.com Outlook and VBA 1 November 17th 06 03:13 PM
New messages and bold text History Fan Outlook Express 8 July 2nd 06 02:23 AM


All times are GMT +1. The time now is 11:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.