Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2011, 08:03 PM
kjxavier kjxavier is offline Find and Replace Windows XP Find and Replace Office 2007
Advanced Beginner
Find and Replace
 
Join Date: Jul 2011
Posts: 39
kjxavier is on a distinguished road
Thumbs up Find and Replace

All i need is Double spaces before and after E-mail Address and another Alphanumeric Marked in RED (at times there wont be any space before E-mail address)



Example 1 (TC_vd-Sdi-IB-BtunVp-0000090494 March 7,2001 (954) 435-2040 108 LG-P-2600 FREE ON 18 MONTHS CONTRACTS 9 75 250 1/2 Rental for 5 Months CORPORATE HARRIET K ABEL TAG ONLINE INC. 1740 MARK MEAD LN HH moises@pacbell.net Greenwood C 61198 Multy Family Home VG115450 jackquolyn rasey VD2140 West Milford Services B 200 400 MasterCard Gold Card H 5072236280141358 January 02, 20Q3 )

Example 2 (TC_vd-Sdi-IB-BtunVp-0000220982 March 7,2001 (540) 371-7962 49 Nokia-3230 FREE ON9 MONTHS CONTRACTS 9 75 250 1/2 Rental for Months PERSONAL HAROLD MONROE ARIES CARGO 5610 VAN GOGH WAY pitt@comcast.net H DALLASKS 99662 Single Family Home H CA697607 Jeffrey Tsu VD101L BEST BUY #375 200 400 MasterCard Titanium 8887505442162508 NovemberOl, 2004 )

Example 3 (TC_vd-Sdi-IB-BtunVp-0000082629 May 1,2003 (530) 673-7915 39 Sony Ericsson-W700i FREE ON 18 MONTHS CONTRACTS 12 100 300 l/2 Rental for 3 Months CORPORATE HAROLDEJ FAGAL THE MUNICENTER 304 WestJefferson olmomigdaba@msn.com MIRA LOMA NY B 24113 Apartment CI464072 Litx R Dahl VD2102 TAOS MOUNTAIN ELECT., INC 200M 400 MasterCard Titanium 1481380726124624 November 01,2002 )

Your help in this matter will be highly appreciated
Attached Files
File Type: docx Find and Replace - HELP.docx (11.4 KB, 8 views)
Reply With Quote
  #2  
Old 07-21-2011, 02:42 AM
macropod's Avatar
macropod macropod is offline Find and Replace Windows 7 64bit Find and Replace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

hi xavier,

If there is no space before the email address, how is the 'Find' supposed to identify where the email address begins? This is easy enough where the email address is preceded by a paragraph break, but is really not possible where it's simply a matter of a missing space.

For an email address preceded by one or more spaces, try a wildcard Find/Replace where:
Find = "[ ]{1,}([! \@]{1,}\@*.[! ]{1,})[ ]{1,}"
Replace = " \1 "

For the alpha-numeric strings, try a wildcard Find/Replace where:
Find = "<[A-Z]{2}[0-9]{6}>"
Replace = "^&"
and set the colour format the replacement as red.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-24-2011, 09:16 AM
kjxavier kjxavier is offline Find and Replace Windows XP Find and Replace Office 2007
Advanced Beginner
Find and Replace
 
Join Date: Jul 2011
Posts: 39
kjxavier is on a distinguished road
Thumbs up Find and Replace

Hi!

The Second Widcard worked perfect.

But the First one for E-mail ID has some prob i quess ! At a place it worked but not on all fields of mail id. All i need is DOUBLE SPACES before and after email.

is there anything wrong with the way i did.

Anyways can you help me with the attached file please and a WILDCARD for the same

Regards and Thanks you for the same
Xavier


Quote:
Originally Posted by macropod View Post
hi xavier,

For an email address preceded by one or more spaces, try a wildcard Find/Replace where:
Find = "[ ]{1,}([! \@]{1,}\@*.[! ]{1,})[ ]{1,}"
Replace = " \1 "

For the alpha-numeric strings, try a wildcard Find/Replace where:
Find = "<[A-Z]{2}[0-9]{6}>"
Replace = "^&"
and set the colour format the replacement as red.
Attached Files
File Type: doc xavier.doc (144.3 KB, 9 views)
Reply With Quote
  #4  
Old 07-24-2011, 05:27 PM
macropod's Avatar
macropod macropod is offline Find and Replace Windows 7 64bit Find and Replace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi xavier,

The first F/R won't work because many (if not all) of the 'email' addresses in your document are formatted as hyperlinks (even though someone has formatted them to look like plain text). You can convert the hyperlinks back to plain text via Ctr-A, then Ctrl-Shift-F9. However, you then will have to do the cleanup work that we discussed in your other thread, because unlinking the hyperlinks will cause the email addresses that lack spaces after them to become joined to the following text. A better way of handling the email addresses would be to use a macro like:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Fld As Field
For Each Fld In ActiveDocument.Fields
  If Fld.Type = wdFieldHyperlink Then
    With Fld.Result
      .Style = "Hyperlink"
      If .Characters.Last.Next <> " " Then .Characters.Last.Next.InsertBefore "  "
      If .Characters.Last.Next.Next <> " " Then .Characters.Last.Next.InsertBefore " "
      If .Characters.First.Previous <> " " Then .InsertBefore "  "
      If .Characters.First.Previous.Previous <> " " Then .InsertBefore " "
    End With
  End If
Next
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-24-2011, 08:32 PM
kjxavier kjxavier is offline Find and Replace Windows XP Find and Replace Office 2007
Advanced Beginner
Find and Replace
 
Join Date: Jul 2011
Posts: 39
kjxavier is on a distinguished road
Thumbs up Find and Replace

I really appreciate your reply on the right time........

Thanks a lot ............
Reply With Quote
  #6  
Old 08-16-2011, 09:23 PM
kjxavier kjxavier is offline Find and Replace Windows XP Find and Replace Office 2007
Advanced Beginner
Find and Replace
 
Join Date: Jul 2011
Posts: 39
kjxavier is on a distinguished road
Default Macro

hI!

Am facing a problem with Macros

i have created some macros for some Find and Replace etc.

For E.g.: Alt + a for Macro 1

but when i press Ctrl + a to select all ......... the macro of Alt + a is played.

If i have assigned a macro to a key ....... i cannot press those keys in combination with Ctrl for any other purpose.

I tried re Installing my Word but the same thing remains

what do i do...........???????
Reply With Quote
  #7  
Old 08-19-2011, 09:56 PM
macropod's Avatar
macropod macropod is offline Find and Replace Windows 7 64bit Find and Replace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi xavier,

See: http://office.microsoft.com/en-us/tr...aspx?section=9
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
find and replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace Find and Replace kjxavier Word 9 08-11-2011 04:47 AM
Find and Replace Help with find and replace or query and replace shabbaranks Excel 4 03-19-2011 08:38 AM
find and replace anil3b2 Word 0 08-03-2010 11:30 PM
help with find and replace sjkiss Word 1 04-12-2010 08:08 AM
Find /Replace Help ilcaa Word 2 11-02-2009 08:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:44 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