Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Jun 2010
    Location
    sydney
    Posts
    164
    Thanks
    22
    Thanked 16 Times in 14 Posts

    Word 2007 - Find quoted (dialogue) text

    How can I find dialogue in a Word 2007 .docx document

    I want to search for text enclosed in “” so that I can see any mismatches or splits

    I tried doing a wildcard search for [“]*[”], and similar things but none of them worked, so I must be doing something wrong

    Thanks NW2222

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Try:
    Find = [“"]*["”]
    I'm not sure how this will help you find mismatches or splits, though, as all it will do is span the range from one set to another.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    2 Star Lounger
    Join Date
    Jun 2010
    Location
    sydney
    Posts
    164
    Thanks
    22
    Thanked 16 Times in 14 Posts
    Quote Originally Posted by macropod View Post
    Try:
    Find = [“"]*["”]
    I'm not sure how this will help you find mismatches or splits, though, as all it will do is span the range from one set to another.
    Thanks, that works better than anything I tried - I'm not looking for anything that will detect the errors, or fix them, just to find blocks within the quotes

    Your string finds well formed and split dialogue but it doesn't find open ended dialogue

    See attachment, I didn't notice the post was hard to read - I am NOT expecting word to do the highlighting as shown - it just illustrates what I mean by split and open dialogue blocks.

    Maybe I will need to use a different search string to find the open dialogue blocks - that would be Ok.

    NW
    Attached Images Attached Images

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    As I said, I doubted it would help identify the splits, per se. Now that I can see what you mean by that, try:
    Find = [“"][!“"”^13]{1,}^13
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    2 Star Lounger
    Join Date
    Jun 2010
    Location
    sydney
    Posts
    164
    Thanks
    22
    Thanked 16 Times in 14 Posts
    Quote Originally Posted by macropod View Post
    As I said, I doubted it would help identify the splits, per se. Now that I can see what you mean by that, try:
    Find = [“"][!“"”^13]{1,}^13
    Thanks

    If the quoted text does not start a paragraph, then your first search term finds complete blocks and split blocks - so the Hello world will be found in para 1 but not in para 2. Your second one does the opposite so the Hello world will be found in para 2 but not in para 1.

    Code:
    para 1 : Mary said, "Hello world."
    para 2 : "Hello world," said Mary.
    Both find text split across a paragraph boundary. I could do two passes, but I'd prefer to only do one pass, is there a way I could 'combine them'

    That still leaves the problem of no closing quote. Maybe I could find that by counting opening and closing counts and stopping when opening_count exceeds closing_count by more the one - I regard nested dialogue text as undesirable.

    NW

  6. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    The problem with any approach is that there is no way of knowing how much text should be scanned before one can be confident there's no closing quote (or conversely, no opening quote). The true range of interest might only be part of a single paragraph, or it could span 10. The logic for finding closing quotes without matching opening quotes is similar, except that you'd need to do a backwards search. Of course, if plain quotes are being used, there's no 100% reliable way of knowing whether they're opening or closing quotes.

    Some time ago, I wrote a macro for doing such searches: http://windowssecrets.com/forums/sho...l=1#post793859
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. The Following User Says Thank You to macropod For This Useful Post:

    northwood2222 (2013-05-21)

  8. #7
    2 Star Lounger
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    122
    Thanks
    3
    Thanked 20 Times in 18 Posts
    The convention for using quotes in multi-paragraph spans is to leave off the ending quote mark on all but the final paragraph (as in your “Open ended dialogue example above), so handling this programmatically will be very complex.

    If the dialog is fairly simple, a quick way to check for matched pairs is to use the Find dialog to count the number of occurrences of “ (^0147) and then ” (^0148). If there are more ending quotes than starting quotes, you'll need to look more carefully -- and perhaps by just dropping out of the dialog and using Ctrl-PgDn or Shift-F4 to jump from one to the next to review by eye.

  9. The Following User Says Thank You to EricFletcher For This Useful Post:

    northwood2222 (2013-05-21)

  10. #8
    2 Star Lounger
    Join Date
    Jun 2010
    Location
    sydney
    Posts
    164
    Thanks
    22
    Thanked 16 Times in 14 Posts
    Thanks macropod & EricFletcher - between the search strings provided here & the macros in the 2011 thread I'm sure I can create an acceptable solution.

    Revising dialogue can often result in mismatches. Another problem is that Word 2007 has a 'feature' whereby if you type a 'smart' quote immediately after an em, en or hyphen at the end of a quoted speech you get an opening 'smart' quote

    EricFletcher - different institutions/editors have different conventions. One editor I know prefers an en at the end, and at the beginning of speech that's broken by narrative. The problem with the leave it open convention is that it can happen as a result of an inadvertent omission of the closing quote. And leaving it open doesn't work if the quoted speech fragments and interposed narrative are in the same paragraph.

    Thanks again for your help.

    NW

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •