JPB
01-06-2008, 06:54 PM
Hi,
I've got a RichTextBox that I only want to handle limited formatting. When a user pastes RTF text from another app (i.e. Word), I intercept that and do the following:
1) Remove any OLE objects
2) Set the fonts to a single font
3) Set the font sizes to a single size
4) Remove superscript/subscript/offsets
Formatting such as bold, italic, underline, etc... is allowed to remain in the pasted text however. This is all working fine.
What I would like to do is prevent pasting of tables/borders from Word (or other software). I've tried EM_SETPARAFORMAT with PFM_TABLE or PFM_BORDER, but the closest I can get leaves the table spacing and borders but colours them white (so they appear invisible, but if you select all text, you can see that they are still there). Any of you have any ideas/success with this?
Thanks,
JPB
I've got a RichTextBox that I only want to handle limited formatting. When a user pastes RTF text from another app (i.e. Word), I intercept that and do the following:
1) Remove any OLE objects
2) Set the fonts to a single font
3) Set the font sizes to a single size
4) Remove superscript/subscript/offsets
Formatting such as bold, italic, underline, etc... is allowed to remain in the pasted text however. This is all working fine.
What I would like to do is prevent pasting of tables/borders from Word (or other software). I've tried EM_SETPARAFORMAT with PFM_TABLE or PFM_BORDER, but the closest I can get leaves the table spacing and borders but colours them white (so they appear invisible, but if you select all text, you can see that they are still there). Any of you have any ideas/success with this?
Thanks,
JPB