none
find words/sentences in a word document by a specific style RRS feed

  • Question

  • I'm try to find all of the words/sentences in a word document that are in a specific style.

    I would like to do something like this:

    object missing = System.Reflection.Missing.Value;
    Document aDoc = WordApp.Documents.Open(ref fileName,
                        ref missing, ref missing, ref missing, ref missing, ref missing,
                        ref missing, ref missing, ref missing, ref missing, ref missing,
                        ref missing, ref missing, ref missing, ref missing, ref missing);
    foreach(object selArea in aDoc.findbyStyle("H1")
    {
        string selText = selArea.Value();
    }

    Microsoft.Office.Interop.Word

    Has anyone done or think of a way to do this?
    Friday, October 27, 2006 8:12 PM

Answers

  • I have found an answer here: http://msmvps.com/blogs/jonathangreensted/archive/2004/12/07/22717.aspx
    Monday, October 30, 2006 3:41 PM