By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,578 Members | 1,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,578 IT Pros & Developers. It's quick & easy.

Convert RTF Text to Plain Text

P: n/a
Hi,

I have written a little Windows Service which converts tons of RTF docs from
RTF to Plain Text. I using the winform rtfbox. How ever sometimes this
crahses in background.

Does anybody know a better way? 3rd Party control or what ever?

Thanks in advance
Anthony

--
Anthony Malt
Feb 13 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
CMM
Total guess here... but .NET doesn't bother to do stuff like create Win32
handles and things like that until you actually *display* the window. This
poses a problem for ActiveX controls. For instance, this led to problems
with the WebBrowser control in 2003. If you instantiated a form that
contained a web browser, but kept it hidden and never showed it (like
because the user never switched to it in your "tabbed" application) it would
crash your application when you exited.

Try showing the form... possibly offscreen (.Left = 0 - .Width, etc). Then
doing the work. I'm not sure how this plays out if your app is running as a
Windows "Service." I think you can still "Show" Windows (just nobody sees
them)... but, I'm not sure about that.

As a work around... every thought of using Word to do the dirty? Word has a
very good object model which would allow you to do this (basically as simple
as wd=CreateObject (or whatever it is in .NET), wd.OpenFile(rtffile)
wd.SaveAs(textfile))

--
-C. Moya
www.cmoya.com
"Anthony Malt" <An**********@sterm.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
Hi,

I have written a little Windows Service which converts tons of RTF docs
from RTF to Plain Text. I using the winform rtfbox. How ever sometimes
this crahses in background.

Does anybody know a better way? 3rd Party control or what ever?

Thanks in advance
Anthony

--
Anthony Malt

Feb 13 '06 #2

P: n/a

"Anthony Malt" <An**********@sterm.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
I have written a little Windows Service which converts tons of RTF docs
from RTF to Plain Text. I using the winform rtfbox. How ever sometimes
this crahses in background.

Does anybody know a better way? 3rd Party control or what ever?


If you have Word, why not use that? IME it will work fine and is easy to
automate.

Feb 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.