.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Flow Document text parsing to render XML documents with foreground color

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :WPF

I need to display some XML in a flow document in read-only mode. Would like to render it with the black, red and blue formatting based on the contents / keywords. I know you can set the foreground color with span elements.

Is there a way to achieve this in a object oriented / dynamic way ? Like you set the content of flow document/paragraph element and it automatically parses the text and sets the foreground color for specific keywords. I am thinking of starting a prototype project with the help of converters - not sure if it can give an extend-able model (for maybe T-SQL someday). May probably have to inherit from flow document and create a custom / user control.

Any thoughts, help or tips would be greatly appreciated.



View Complete Post

More Related Resource Links

Dynamic WPF: Create Flexible UIs With Flow Documents And Data Binding


Flow documents offer enormous flexibility in arranging text layout and pagination, but they don't support data binding, so you can't dynamically change content. Here we build a component to solve that problem.

Vincent Van Den Berghe

MSDN Magazine April 2009

Foundations: Render Text On A Path With WPF


With Windows Presentation Foundation (WPF) you can lay out text on a path, then animate the individual points defining the path and watch the characters bounce around in response.

Charles Petzold

MSDN Magazine December 2008

WPF: Flexible Content Display With Flow Documents


Markus Egger discusses all the flexibility and power of flow documents in Windows Presentation Foundation

Markus Egger

MSDN Magazine August 2007

Full text search in a Word document



  I´m currently programming a web search application in ASP.Net and having problem with full text searching. My requirements are:

1. Save a byte array from SQL server to word document as a temp file in a server side?

2. How to highlight the string I am currently searching in the Word document and return to the user the sentence with the highlighted string (like on Bing or any other search engines)? Is it possible to fullfill this requirement with full-text search integrated in SQL Server 2008?

Thanks in advance,




The file reached the maximum download limit. Check that the full text of the document can be meaning



I'm facing an issue with the indexing.

I have 1 WFE+Index server+DB server.

Index server is not installed with MS FIlter pack 1.0

When crawling, the there will be document with warning in crawl log:
The file reached the maximum download limit. Check that the full text of the document can be meaningfully crawled.

Documents that with warning are such as doc, ppt, xls, docs, ppts and many others.
However, I view into the successful crawled document, there are doucments with ext doc and ppt.

For large file index, there are MaxGrowthFactor + MaxDownLoadSize required to be added into the index server.

As my understanding is, MS Filter Pack should installed into index server(already did, correct me if i'm wrong).

I looked into the Office SharePoint Seach(CA>Services in farm), if the server is appointed to "Use this server as indexing server", then MS Filter Pack is suppose to be installed into that particular server as well.

At the bottom, there also has another option is "Use all web front end for crawling".

The question here is, IF the option "Use all web front end for crawling" is selected.
Does the WED FRONT END Server required to installed the Ms Filte

Search does not find text in Word document stored in document library on a Report Center site within



We have a document library on a site created off of the Report Center site template. We uploaded a Word 2007 document with the word zebra in the text. Using the search bar at the top of the page we selected This list: Our document library and searched for zebra. We received no results.

We tested the same thing on another site (site template Team site) within the same site collection and search worked fine.

Does the Report Center search function differently then the search functionality on the Team site?

Tamara Bredemus SharePoint Minion...working up to Maven

Replace text in a word document stored in a Document Library


Hi to all,

im tying to replace some text introduced in a word document stored in a document library.

Exactly i need a web part with a button that change a key in a word template <list> (for example) and replace <list> with a text in another list.


I think that it would works with the Microsoft.Office.Word.Interop; namespace but when i call the function :

wDoc = wordApp.Documents.Open(ref fileName, ref missing,
                                ref readOnly, ref missing, ref missing, ref missing,
                                ref missing, ref missing, ref missing, ref missing,
                                ref missing, ref isVisible, ref missing, ref missing,

Document viewer on a documents Library & Tooltip Bubble on rollover

Hi everybody,
1 - I would like to know, if in Sharepoint 2007 ECM part (Documents Library), there's a downloadable webpart or an application to create a document viewer (pdf, doc, xls, msg...) in an iframe when you point the mousse over a document or something like that...
If it doesn't exist do you have in mind a code sample which can make something like that ? thank you.

2 - It's possible in a documents library to activate balloon tooltips which show us metas of the document (on mousse over), like an option or an application...

Thank you very much.
All the best.
Go I.T.

How to find the content height of the Flow document?

Hi Dudes, I have a RichTextBox control in my application. When the user types the content inside the RichTextBox and clicks ok i need to validate such that the content that the user entered should not overflow the controls Height. So i need to find the height of the FlowDocument property of the RichTextBox Control. I dont have an option to find the height found one way from surfing around        double GetDocumentHeight()         {             Rect rectStart = Document.ContentStart.GetCharacterRect(LogicalDirection.Forward);             Rect rectEnd = Document.ContentEnd.GetCharacterRect(LogicalDirection.Forward);             if (!Double.IsInfinity(rectEnd.Bottom) && !Double.IsInfinity(rectStart.Top))             {                 return rectEnd.Bottom - rectStart.Top;             }             else             {        

Replace Text in textbox in word document using interop and asp.net

Hi all,  I'm trying to create a function to replace fields in a word document using asp.net. The fields are marked in the document using ###field### and I need to replace them with the data from the DB. The code I have works fine for the body of the word document but doesn't appear to work if the text is contained within a textbox, is there a way to correct this? Here's the code I am currently using Dim Contract as string Dim word As New Word.Application        Dim doc As Word.Document        Try            word.Documents.Open("c:\FYI.doc")            word.Visible = True             doc = word.ActiveDocument            Dim myStoryRange As Microsoft.Office.Interop.Word.Range            For Each myStoryRange In doc.StoryRanges                With myStoryRange.Find                    .Text = "###field###&quo

force document 'save as' for visitor users for all documents.

hello we are using foundation as the basis for a customer extranet, one of the 'features' of sharepoint seems to be the inconsistancy of how it handles office and non-office documents. for pdf's the user is prompted for save as. For word docs if the (remote Ad authenticated )user has word this opens the document for the site and reprompts for credentials, i usderstand why this is happening as they are opening the document on different network. the question is can i force 'save as' for word and excel documents in the manner of pdfs for visitor level users. Thanks Mark  

convert xml file as text file using xml document

hi i want to convert to xml file to text file using xml document.. M not much aware of xml..so please guide me.... my boss told me don use xmltextreader and using xml document convert to txt file.....  

WSS2.0 opening pdf documents an error message appears: The document could not be saved. The file may

Hi All,. In a WSS2.0 document library, a user is trying to open pdf files. However, an error message is displayed: 'The document could not be saved. The file may be read only, or another user may have it open. Please save the document with a different name or in a different folder'. No one else has the file open. When the user saves the file using Save As (as it is apparently Read Only) and then saves the file back to the SharePoint site, all previous versions of the file disappear. The user has noted that this has been happening since today, and she had some other network issues that have been resolved. No other users are experiencing this problem.  Not sure if this problem is related to the network problems the user was facing. I've had the user reboot but this has not resolved it. Any ideas?

Upload documents to Sharepoint 2010 Document library

Is there a way to upload documents to an SP 2010 document library with Custom Actions or Workflows?  I have a requirement of taking the contents of several directories (older data files) and uploading them to Sharepoint.  Not sure which actions actually perform this operation.  Any help most greatly appreciated.

Sharing Documents among Document Sets

I've been looking at Document Sets and the examples given answer many of my questions on what Document Sets are, and what they can and can't contain.  One thing I am not sure of is can I share a document among multiple Document Sets?  If I am going to have a common document among my Document Sets, say in the Sales Presentation examples used to explain Document Sets I have one document that will always be the same, do I need to upload that document into each and every Document Set or can I share it?  What if I am going to have a common document among only a few Document Sets, and those may cross over Content Types, is this an upload for each Set or can I somehow link into the Document? Thanks!

Converting Word Documents library to PDF document library in SharePoint Server 2007

My project requires me to create an event reciever such that when a word file is added to one library the same content pdf file should be added to other library also when a word file is updated,edited or checked in the respective pdf file in other document library should be replaced by a new pdf file with the edited word content . Can we do this in Sharepoint 2007 I have seen this can be done in Sharepoint 2010 http://msdn.microsoft.com/en-us/library/ff181518.aspx

Opening office Documents in MOSS 2007 document Library.... You get a prompt to login...

*Sigh* i know i'm not the only one who has experienced this.   You have a Moss 2007 farm on your Server... yet you have employees and users who use Office 2003 products (word, excel, power point) Everything is installed correctly you yourself use office 2007. but don't post office 2007 docs.. just open the docs that people already post (2003 stuff) Computer Environment si am using....It does this in both Environments1st one Windows Vista Ultimate Updated Service Packs Office 2007 All update Serice Packs Internet explorer 7.0 2nd Environment Windows XP all updated Service Packs Office 2007 All updated Service Packs Windows Internet Explorer 7.0 Server Environment Moss 2007 with SP1 installed Microsoft 2003 Server No matter what happens.... when i try to open up a word documents or excel or anything.. when using office 2007..... it ask me for a login...I believe there was an article about correcting something in the registry or something.. can someone give me detail bulleted / bold instructions... this has been bothering me for a while.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend