Community
Showing results for 
Search instead for 
Do you mean 
Reply

Remove History formatting

Accepted Solution Solved
New Member
Posts: 14
Country: United_Kingdom
Accepted Solution

Remove History formatting

Any one got any ideas of what I should do to remove the formatting from a history record entered in act

I tried deleting everything between { and }  but I still have the problem of the text adjoined to the description.

 

Below is an example of the formatting act puts in the details:

{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 test\par
}

 I have got it to this

 

;}}
\viewkind4\uc1\pard\f0\fs17 test\par
}

 

Any help will be appreciated


Accepted Solutions
Solution
Accepted by topic author Blag24
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Remove History formatting

Hi,

 

A quick rough and ready way could be to create rtf box and parse the rtf string to it and then extract plain txt from rhe rtf box:

 

System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox();

rtBox.RTF = myRTFTxt;

 

string plainTxt = rtBox.Text;

 

rtBox = null;

 

HTH

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog

View solution in original post


All Replies
Solution
Accepted by topic author Blag24
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Remove History formatting

Hi,

 

A quick rough and ready way could be to create rtf box and parse the rtf string to it and then extract plain txt from rhe rtf box:

 

System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox();

rtBox.RTF = myRTFTxt;

 

string plainTxt = rtBox.Text;

 

rtBox = null;

 

HTH

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
New Member
Posts: 14
Country: United_Kingdom

Re: Remove History formatting

[ Edited ]

I couldn't quite use your solution as it is in a DLL file but it using a rich text box control in the final application worked

 

Thanks for the help once again 

Nickel Contributor
Posts: 175
Country: USA

Re: Remove History formatting

Just a note on Vivek's solution in Blag24's situation, for those who come afterwards.

 

You can use the RichTextBox in a DLL, you just need to add a reference to System.Windows.Forms in your project.

New Member
Posts: 14
Country: United_Kingdom

Re: Remove History formatting

I tried that by both writing Imports System.Windows.Forms and looked in references in the project properties. When the check box wasn't there in project properties and didn't appear in intellisense I presumed it wasn't possible but thanks for telling me and others