PC Review


Reply
Thread Tools Rate Thread

Appointment RTF format problems using Redemption

 
 
=?Utf-8?B?Sm9obiBTdmVyY2Vr?=
Guest
Posts: n/a
 
      12th Jan 2006
I am developing an addin for Outlook 2000 using vb6 and Redemption. The addin
inserts code into the body of an appointment when a button is clicked. I have
two problems, 1) when the RTF text is added to the body the format characters
are no longer there, and 2) the added text does not show until I go thru the
code a second time, this results in the previous text appearing and the
current text is not visible.

Here is my code snippet that adds the text.

Any suggestions would be appreciated.

Thanks, John



Dim MyAptmntItm As Object
Dim MyOAptmntItm As Object
Dim BdyPstn As Long
Dim HoldMsg As String

If TypeOf m_oApp.ActiveInspector.CurrentItem Is Outlook.AppointmentItem Then

'create SafeAppointmentItem from this appointment
Set MyAptmntItm = CreateObject("Redemption.SafeAppointmentItem")
Set MyOAptmntItm = m_oApp.ActiveInspector.CurrentItem
MyOAptmntItm.Save
MyAptmntItm.Item = MyOAptmntItm

'Need to put something in the body & save it so the rtf header
information is created
MyAptmntItm.Body = MyAptmntItm.Body & vbCrLf
MyAptmntItm.Save

'copy body to string & manipulate it
HoldMsg = MyAptmntItm.rtfBody
'JCS FIX need to find the last } & break message just before it,
'for now hard code it
BdyPstn = Len(HoldMsg) - 4
'add bold text to appointment body in RTF format
HoldMsg = Left(HoldMsg, BdyPstn) & " \b TEST \b0\par }"
MyAptmntItm.rtfBody = HoldMsg
MyAptmntItm.Save

Set MyAptmntItm = Nothing
Set MyOAptmntItm = Nothing
End If

--
John Svercek
 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      15th Jan 2006
1. I am not sure that the way you manipulate the RTfFbody produces valid RTF
data. Did you try to save it to a file and open using WordPad?
2. Outlook does not see changes made with Extended MAPI (Redemption) until
the item completely dereferenced and reopened.

You might want to use SafeInspector object instead (swince you are
apparently displaying the appointment anyway). Use the RTFEditor object to
manipulate the modify the RTF contents.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"John Svercek" <(E-Mail Removed)> wrote in message
news:AA538C9C-E20A-44A6-AAE1-(E-Mail Removed)...
>I am developing an addin for Outlook 2000 using vb6 and Redemption. The
>addin
> inserts code into the body of an appointment when a button is clicked. I
> have
> two problems, 1) when the RTF text is added to the body the format
> characters
> are no longer there, and 2) the added text does not show until I go thru
> the
> code a second time, this results in the previous text appearing and the
> current text is not visible.
>
> Here is my code snippet that adds the text.
>
> Any suggestions would be appreciated.
>
> Thanks, John
>
>
>
> Dim MyAptmntItm As Object
> Dim MyOAptmntItm As Object
> Dim BdyPstn As Long
> Dim HoldMsg As String
>
> If TypeOf m_oApp.ActiveInspector.CurrentItem Is Outlook.AppointmentItem
> Then
>
> 'create SafeAppointmentItem from this appointment
> Set MyAptmntItm = CreateObject("Redemption.SafeAppointmentItem")
> Set MyOAptmntItm = m_oApp.ActiveInspector.CurrentItem
> MyOAptmntItm.Save
> MyAptmntItm.Item = MyOAptmntItm
>
> 'Need to put something in the body & save it so the rtf header
> information is created
> MyAptmntItm.Body = MyAptmntItm.Body & vbCrLf
> MyAptmntItm.Save
>
> 'copy body to string & manipulate it
> HoldMsg = MyAptmntItm.rtfBody
> 'JCS FIX need to find the last } & break message just before it,
> 'for now hard code it
> BdyPstn = Len(HoldMsg) - 4
> 'add bold text to appointment body in RTF format
> HoldMsg = Left(HoldMsg, BdyPstn) & " \b TEST \b0\par }"
> MyAptmntItm.rtfBody = HoldMsg
> MyAptmntItm.Save
>
> Set MyAptmntItm = Nothing
> Set MyOAptmntItm = Nothing
> End If
>
> --
> John Svercek



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Format Lost [Redemption] bbnimda Microsoft Outlook Form Programming 1 14th Nov 2008 10:34 PM
C#, Redemption, not able to set appointment color in Outlook 2003 Johan Machielse Microsoft Outlook Program Addins 2 23rd Jul 2008 03:36 PM
adding an appointment to another users calendar using redemption mjs11 Microsoft Outlook Program Addins 0 3rd Jul 2006 06:05 AM
Setting Appointment Labels Using Redemption Mark Milliman Microsoft Outlook VBA Programming 11 6th Oct 2005 06:13 AM
Outlook Appointment Item + Redemption Security Warnings Ben Crinion Microsoft Outlook Program Addins 3 31st Jan 2005 11:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 PM.