Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2016, 09:38 PM
billob billob is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2003
Novice
Can't search for---
 
Join Date: Sep 2016
Posts: 10
billob is on a distinguished road
Default Can't search for---

My 500+ page WORD 2003 document has 40-50 examples of 3 dashes --- following a tab.

Searching for --- turns up nothing as does tab code---



I have tried shutting down and restarting my WORD 2007 with no luck.

How can I do this search?

Last edited by billob; 09-24-2016 at 09:40 PM. Reason: Left out version
Reply With Quote
  #2  
Old 09-24-2016, 11:52 PM
macropod's Avatar
macropod macropod is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That really depends on what types of dashes you're working with. Some of these might superficially look the same:
- − ― – —
but they actually consist of a:
• hyphen
• minus sign
• horizontal bar
• en-dash
• em-dash
To cater for all these possibilities you could use a wildcard Find, where:
Find = ^t[\-\−\―\–\—]{3}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-25-2016, 09:16 AM
billob billob is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2003
Novice
Can't search for---
 
Join Date: Sep 2016
Posts: 10
billob is on a distinguished road
Default

Hi Paul:

Thank you for your response.

This is absolutely crazy!

Sorry to say, I could not make what you sent work.

Today my Find --- (the the lower half of the underscore key) works just fine like
I thought it should have in the first place.

Now for the toughie?

I have several thousand lines with "several words in between" Always on one line.
How can I find lines that have only one " ?
Reply With Quote
  #4  
Old 09-25-2016, 09:51 PM
macropod's Avatar
macropod macropod is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by billob View Post
Sorry to say, I could not make what you sent work.
As indicated in my previous post the expression is for a wildcard Find. Did you check the use wildcards option?
Quote:
Originally Posted by billob View Post
I have several thousand lines with "several words in between" Always on one line.
How can I find lines that have only one " ?
You could use a macro such as:
Code:
Sub TestQuotes()
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
  With oPara.Range
    If (Len(.Text) - Len(Replace(.Text, Chr(34), vbNullString))) Mod 2 <> 0 Then
      .Select
      MsgBox "Selected paragraph has unmatched plain quotes", vbExclamation
      Exit Sub
    End If
    If Len(Replace(.Text, Chr(147), vbNullString)) <> Len(Replace(.Text, Chr(148), vbNullString)) Then
      .Select
      MsgBox "Selected paragraph has unmatched smart quotes", vbExclamation
      Exit Sub
    End If
  End With
Next
End Sub
The above macro checks each paragraph for any unmatched double-quote characters. Mixes of straight & smart quotes aren't assumed to balance each other – there must be balancing pairs (e.g. "xxx" or “xxx”).

For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 09-26-2016, 09:02 AM
billob billob is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2003
Novice
Can't search for---
 
Join Date: Sep 2016
Posts: 10
billob is on a distinguished road
Default

Hi Paul:

Thanks again for your help.

Yes, The wildcard box was the first thing I checked for when it did not work.

That said, it worked perfectly today.

I have been using this Find function for umpteen years and it has always had a
way of sometimes not finding something I know is there. When this happens, I test by asking it to find any alpha or numeric character that I am currently viewing and if it comes up 'no find' I shut down Word and then reboot.

If I simply restart Word, when I click find, the last thing I searched for will still
be there, Hence the Reboot.

Having never used Word's Macro thing I'll have to give it a try.

Many years ago I was fairly successful with Excel Macros.

Cheers,
Billob
Reply With Quote
  #6  
Old 09-26-2016, 04:31 PM
billob billob is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2003
Novice
Can't search for---
 
Join Date: Sep 2016
Posts: 10
billob is on a distinguished road
Default

Hi Paul:

I can get the macro to run until it's first 'hit' occurs.

This example has it's " on two different lines which in this case is OK.

The problem is I can't get the macro to go any farther unless I fix this condition.

How do I get the macro to skip over this 'hit' and continue on?

Best regards,
Billob
Reply With Quote
  #7  
Old 09-26-2016, 06:35 PM
macropod's Avatar
macropod macropod is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by billob View Post
I can get the macro to run until it's first 'hit' occurs.
...
The problem is I can't get the macro to go any farther unless I fix this condition.

How do I get the macro to skip over this 'hit' and continue on?
That's how it was intended to work. If you want it to work from just the current selection (which means you'd have to select the range to process), change:
ActiveDocument
to:
Selection
or, to work from there to the end of the document, change:
ActiveDocument.Paragraphs
to:
ActiveDocument.Range(Selection.Start, ActiveDocument.Range.End).Paragraphs
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 09-26-2016, 09:09 PM
billob billob is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2003
Novice
Can't search for---
 
Join Date: Sep 2016
Posts: 10
billob is on a distinguished road
Default

Hi Paul:

Thanks again.

I tried both approaches, one at a time with no change whatsoever in the result.

The macro stops at and highlights the first hit and will go no farther. A message tells me that the macro found an unpaired quote.

Since you mentioned 'selection', I also tried clicking 'select all' prior to launching the Macro but that did not work as when the macro highlights the first hit, the 'select all'
highlighting goes away as I expected it would.

Am I not understanding what you mean by 'selection'?

If I could chose my starting points I could fix the hits that are bad and jump over the hits that are OK as is and continue on.

If it could be made to highlight all 'hits', that would work but every time I fix a highlighted hit, all of the other highlights would probably go away and I would have to run the macro again to re highlight them but I could still do the job.

Any Ideas will be appreciated.

For the most part what I am trying to find is one line two or three word name like
"Cox Babe Bee" or Fox .59" with one of it's quotes missing or being an incorrect character.

Best regards,
Billob
Reply With Quote
  #9  
Old 09-27-2016, 01:59 PM
macropod's Avatar
macropod macropod is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Both revisions work as specified. The: first one requires you to select the range you want to test; second one requires only that you position the insertion point where you want the macro to start testing from. In either case, the macro will exit at the first mismatched paragraph in the specified range. I don't know what could be simpler.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #10  
Old 09-27-2016, 04:20 PM
billob billob is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2003
Novice
Can't search for---
 
Join Date: Sep 2016
Posts: 10
billob is on a distinguished road
Default

Hi Paul:

I think I now understand what you are trying to say and will try later, hopefully tonight.

Is there anyway short of creating the whole macro again that I can assign a shortcut key to it?

Best regards,
Billob
Reply With Quote
  #11  
Old 09-27-2016, 04:50 PM
macropod's Avatar
macropod macropod is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you copy & paste the macro into a code module attached to Word's 'Normal' template, it will be available for use with all documents. There is no need to recreate the macro each time; If Word prompts you to save the template changes, let it do so. That said, you can also assign macros to keyboard shortcuts. See: http://word.mvps.org/faqs/customizat...roToHotkey.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 09-28-2016, 12:01 PM
billob billob is offline Can't search for--- Windows 7 64bit Can't search for--- Office 2003
Novice
Can't search for---
 
Join Date: Sep 2016
Posts: 10
billob is on a distinguished road
Default

Hi Paul:

The macro is now doing what I need it to do.

Thank you very much for the assistance.

Best Regards,
Billob
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use CSV as search criteria for Outlook search folder lonesoac0 Outlook 0 03-07-2016 02:31 PM
Onenote 2013 search is not identifying search terms correctly Delta223 OneNote 0 08-12-2014 06:40 AM
Search for date and then apply mutliple search criteria in huge dataset maxtymo Excel 2 12-01-2013 04:52 AM
Looking for Windows Search app with ability to search by content gopher_everett Office 1 02-28-2013 09:23 PM
Search and Replace - Clear Search box JostClan Word 1 05-04-2010 08:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft