none
Get Hidden text from a range/paragraph RRS feed

  • Question

  • HI,

           How to get hidden text from a set of range or paragraph in word document. i tried this but no success

    foreach (Paragraph para in dynamicRange.Paragraphs)
                        {

     if (para.Range.Font.Hidden != 0)
                                {
                                    string temp= para.Range.Text; // no success , 

    string temp2= para.Range.FormattedText.Text; //no success

                                    break;
                                }

                }

    thanks


    shashank


    • Edited by shashank Wednesday, July 4, 2012 8:45 AM
    Wednesday, July 4, 2012 8:44 AM

Answers

  • Hi Shashank

    You need to specify the TextRetrievalMode for a Range object - and you need to have a specific Range object. For example:

      Word.Range paraRange = para.Range;
      paraRange.TextRetrievalMode.IncludeHiddenText = true; //may require -1 instead of true, you need to test


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by shashank Wednesday, July 4, 2012 11:35 AM
    Wednesday, July 4, 2012 9:31 AM
    Moderator

All replies

  • Hi Shashank

    You need to specify the TextRetrievalMode for a Range object - and you need to have a specific Range object. For example:

      Word.Range paraRange = para.Range;
      paraRange.TextRetrievalMode.IncludeHiddenText = true; //may require -1 instead of true, you need to test


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by shashank Wednesday, July 4, 2012 11:35 AM
    Wednesday, July 4, 2012 9:31 AM
    Moderator
  • Thanks a lot. it solved my problem.

    thanks


    shashank

    Wednesday, July 4, 2012 11:37 AM