Read text from Word Documents, allowing for Field Codes, Tables,Shapes etc

Discussion in 'Word VBA' started by jon.d.morrell@googlemail.com, Feb 18, 2014.

  1. Guest

    I am writing a tool that is an in-house checking mechanism for Word documents. The tool is written in c#. By the nature of the tests we need to read the text of the document into C#. The problem we have is that when we find something in our string, we need to show it on the document and so the indexof any text in the string must match the corresponding position in the document.

    But after a lot of time trying to work out adjustments for field codes and their different behaviours, as well as the many different shapes and tables, etc., in a document, I cannot find a fast reliable way to do this.

    I know a slow way to do it reliably, by reading in each word in the document, together with its start position then pad with some blanks, but this is far too slow.

    Please don't comment if you are going to suggest doing my checking within the document itself rather than reading a string into code, I have been downthis road and there are things that cannot be done.

    Thanks.
     
    , Feb 18, 2014
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Dawn

    Using text from field codes

    Dawn, Aug 15, 2003, in forum: Word VBA
    Replies:
    2
    Views:
    231
    Jay Freedman
    Aug 15, 2003
  2. Jason

    advance word field codes

    Jason, Sep 17, 2003, in forum: Word VBA
    Replies:
    1
    Views:
    188
    Jay Freedman
    Sep 17, 2003
  3. Tony Gravagno

    Operations on text which includes field codes

    Tony Gravagno, Feb 12, 2005, in forum: Word VBA
    Replies:
    1
    Views:
    104
    Klaus Linke
    Feb 12, 2005
  4. Mad Scientist Jr
    Replies:
    7
    Views:
    164
    Steve Rindsberg
    Jan 5, 2006
  5. Fuzzhead

    Protected documents and shapes

    Fuzzhead, Jul 22, 2007, in forum: Word VBA
    Replies:
    5
    Views:
    123
    Jay Freedman
    Jul 23, 2007
  6. Renée
    Replies:
    4
    Views:
    242
    Graham Mayor
    Jan 5, 2008
  7. hcaoelgod

    Vba excel add tables & shapes in word

    hcaoelgod, May 25, 2010, in forum: Word VBA
    Replies:
    1
    Views:
    224
    Jay Freedman
    May 25, 2010
  8. andreas
    Replies:
    0
    Views:
    277
    andreas
    Dec 28, 2010
Loading...