Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

non breaking space Word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ann Marie - 27 Aug 2006 04:12 GMT
I have bookmark code to find non breaking space and convert. But how do I
set search string in Find - looking for serach string::

ASDN 12 123 123 123
19 July 2008 12 December 2007

So I can do find and replace all.

ActiveDocument.Bookmarks(1).Range.Find.Execute _

Findtext:=" ", _

ReplaceWith:="^s", _

Replace:=wdReplaceAll
Doug Robbins - Word MVP - 27 Aug 2006 06:57 GMT
Where do you want the non breaking space in place of each space in

ASDN 12 123 123 123
19 July 2008 12 December 2007

which is I assume what is contained in the first bookmark in the document or
just between the last 123 and the 19 of the July date?

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have bookmark code to find non breaking space and convert. But how do I
>set search string in Find - looking for serach string::
[quoted text clipped - 11 lines]
>
> Replace:=wdReplaceAll
Ann Marie - 27 Aug 2006 07:25 GMT
Hi Doug,

I will try to clarify:

In any word that has "ASDN xx xxx xxx xxx" non breaking for all the spaces
in the quotes.

Non breaking between any date and month "10 "May 2006

I am not bookmarking I an using an array to replace list to throw the data
in and want to run a routnine find replace on the above after my array
populates - just not sure how best to do it?

ASDN is the same as is structure of  2space3space3space3. I can hard code
but still require a routine to search the rest of the document as a format
check routine?

Is it possible do you think?

> Where do you want the non breaking space in place of each space in
>
[quoted text clipped - 19 lines]
>>
>> Replace:=wdReplaceAll
Graham Mayor - 27 Aug 2006 07:15 GMT
Do I take it that you are trying to replace the spaces in the two strings
with non-breaking spaces (as indicated by your code snippet, but not your
question?)

Are these strings always together? Does the first part always have the same
number of letters digits and spaces? Are the two strings separated by a line
feed of a paragraph? You will need to provide more information, but to get
you started see http://www.gmayor.com/replace_using_wildcards.htm

Given that you have run two dates together I will assume that these strings
have nothing to do with one another. You can find dates with

([0-9]{1,2}) ([ADFJMNOS][a-z]{2,}) ([0-9]{4})
replace with
\1^0160\2^0160\3
(set wildcard switch)

The simple string is easier. If the strings are always the same length,
search for
([A-Z]{4}) ([0-9]{2}) ([0-9]{3}) ([0-9]{3}) ([0-9]{3})
replace with
\1^0160\2^0160\3^0160\4

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I have bookmark code to find non breaking space and convert. But how
> do I set search string in Find - looking for serach string::
[quoted text clipped - 11 lines]
>
> Replace:=wdReplaceAll
Ann Marie - 27 Aug 2006 07:44 GMT
Yes Graham,

I have read it thanks (now you know how I get into these messes) - and am
not as proficient as yourself. I tossed the data to Word doc with replace
list array (so no formatting). I was hoping to put a routine at end of array
to search the document.

The string is "ASDN#xx#xxx#xxx#xxx" (where hash is soft space I want non
breaking space always without exception - the string is together.

The date is "10#m"onth year. So hash should be a ^s YES is it possible?

Thank you so much Graham and Doug for suggestions I shall try them.

I do have another problem while here - in 2007 Beta 2 VBA Find and Replace
does not show in my ADD-INS yet all my other add-ins do? Any ideas? The code
works fine? And in 2003 it is working fine.

Anyway back to my non breaking spaces.... and THANK YOU.

What's the expression - TOO MUCH KNOWLEDGE is a dangerous thing - I am
drowning in ideas....

> Do I take it that you are trying to replace the spaces in the two strings
> with non-breaking spaces (as indicated by your code snippet, but not your
[quoted text clipped - 34 lines]
>>
>> Replace:=wdReplaceAll
Ann Marie - 27 Aug 2006 08:02 GMT
Perfect - thank you Graham.

> Do I take it that you are trying to replace the spaces in the two strings
> with non-breaking spaces (as indicated by your code snippet, but not your
[quoted text clipped - 34 lines]
>>
>> Replace:=wdReplaceAll
Ann Marie - 27 Aug 2006 08:13 GMT
Graham - I have another question

10 May 2006

33 September 2007

4 June 2004

23 MAY 2006

I just replaced on above group as a test and the UPPERCASE (last) entry did
not alter? I did a wildcard search - MATCH CASE is not available? Can I fix
this or not?

([0-9]{1,2}) ([ADFJMNOS][a-z]{2,}) ([0-9]{4})
replace with
\1^0160\2^0160\3
(set wildcard switch)

Many thanks.
"Graham Mayor" <g

mayor@REMOVETHISmvps.org> wrote in message
news:OainRBayGHA.4576@TK2MSFTNGP06.phx.gbl...
> Do I take it that you are trying to replace the spaces in the two strings
> with non-breaking spaces (as indicated by your code snippet, but not your
[quoted text clipped - 34 lines]
>>
>> Replace:=wdReplaceAll
Doug Robbins - Word MVP - 27 Aug 2006 09:19 GMT
Try:

([0-9]{1,2}) ([A-z]{3,}) ([0-9]{4})

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>   Graham - I have another question
>
[quoted text clipped - 59 lines]
>>>
>>> Replace:=wdReplaceAll
Graham Mayor - 27 Aug 2006 09:28 GMT
A minor change will fix that -

([0-9]{1,2}) ([ADFJMNOS][A-Za-z]{2,}) ([0-9]{4})
replace with
\1^0160\2^0160\3
(set wildcard switch)

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

>   Graham - I have another question
>
[quoted text clipped - 66 lines]
>>>
>>> Replace:=wdReplaceAll
Ann Marie - 27 Aug 2006 09:50 GMT
Yes, THANK YOU just read that now last thing in my library on GOTCHAS"

THANK YOU so much for all the help guys.  It works perfectly.

>A minor change will fix that -
>
[quoted text clipped - 73 lines]
>>>>
>>>> Replace:=wdReplaceAll
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.