Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Pasting markup (HTML) text into a document programmatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PromisedOyster - 15 Aug 2005 12:56 GMT
We have a C#/Word interop program that creates and populates word
documents. I want to extend this so that the word document can have
bold, underline, italic etc.

The text that we paste into our documents is fed from a database.
Therefore, what I want to have in the database is something like
'<b>Hello</b><u> World</u>' as opposed to simply 'Hello World'

When I try this, these just get treated literally
Bruce Maples - 31 Aug 2005 23:20 GMT
Well -- how are you inserting the text? Mailmerge? You're going to
have to write some code that parses what is coming out of the
database, then applies the formatting as the text goes into the Word
doc.

Your codes get treated literally because Word doesn't know what you
want to do -- treat them as HTML, or just typing?

It may be ugly, depending on how you do it -- you could parse
character by character, OR perhaps you could do a search-and-replace
once the text is in there.

Good luck.

>We have a C#/Word interop program that creates and populates word
>documents. I want to extend this so that the word document can have
[quoted text clipped - 5 lines]
>
>When I try this, these just get treated literally

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.