Alan,
Nothing like trying to create a good complex regexp pattern to boggle the mind.
The pattern you're trying to use is actually a .net code and converting the way he did it to VBA will take a little more. I don't really think that will clean all RTF codes, likely just the ones they have...
I know what you mean about the richtx32.ocx in vba, you get that silly access issue. If you have VB you can put that control in a container and register that library, though you may want to google for a "richedit" control from another one of the MVPs (I seem to recall using that at one point)...
>>I can't believe I'm pushing a non regex solution
LOL I hear you. I thought the same thing, but in his previous question he is retrieving "Me!txtcusRTF.Text" and not TextRTF
Alan, for what it's worth, the pattern I use in the function above just simply looks for a { and } and removes those...
Hi Alan,
I'll admit that I don't know the ins and outs of RTF formatting. But using the first suggestion quoted above, this will find those matches and replace them with an empty string.
Function StripRTFCodesFromText(ByVal RTFString As String) As String
Dim RegEx As Object
Set RegEx =...
Hi again,
The library (at least on my machine, Windows 2000 and Office 2000) is C:\WINNT\System32\FM20.DLL. I would imagine on XP it would be at Windows instead of WINNT, I can verify that for you later if need be.
I do have Access 2003 installed on this machine as well (the original post was...
Hi Alan,
The DataObject is not part of ADO (though the name would have you think it was), it is actually part of the MSForms library. Check the references for your project, and verify there is a reference to Microsoft Forms 2.0 Object library. It should be set by default, but it could have...
Hi Jens,
Using MSForms' data object you can just put a blank string into the clipboard, effectively clearing it:
Sub ClearClipboard()
Dim DatObj As DataObject
Set DatObj = New DataObject
DatObj.SetText ""
DatObj.PutInClipboard
End Sub
Matt
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.