J
John Svercek
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
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