Reply
 
Thread Tools Display Modes
  #1   Report Post  
Doug Robbins
 
Posts: n/a
Default Searching for formats

Use the following code in a macro

Dim myrange As Range, Flag As Boolean
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Font.Italic = True
Do While .Execute(FindText:="^$", Format:=True, MatchWildcards:=False,
Wrap:=wdFindStop, Forward:=True) = True
Set myrange = Selection.Range
Flag = True
While Flag = True
myrange.End = myrange.End + 1
If myrange.Characters(myrange.Characters.Count).Font. Italic =
False Then
Flag = False
End If
Wend
myrange.End = myrange.End - 1
myrange.Text = myrange.Text & " "
Selection.MoveRight Unit:=wdWord
Loop
End With


--
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
"Kuko" wrote in message
...

Hi.

I've received six huge (400+ pages) documents from a friend. There
is a typing mistake which appears quite often, and consists in the
fact that the word right after an italic or boldfromatted word are
"attached" to it (i. e., he didn't typed the space). Graphically, the
typing error is the following (being the text enclosed in "_" the
italic or bold formated word):

_blablabla_moreblablabla

The document is full of technical terms, so it is not clever to use
the spell checker. There is a way to search for an "italic+nonitalic"
and "bold+notbold" (without spaces between them) pieces of text? It'll
be nice.

I'm on Word 2000 (SP 3).

TIA



  #2   Report Post  
Jezebel
 
Posts: n/a
Default

Here's another approach:

1. Search for: leave blank, set formatting to italic. Replace with: ^&XXX
where 'XXX' is any string that doesn't otherwise occur in your document.

2. With 'Wildcards' checked, search for: XXX([a-z0-9]) Replace with:
[space]\1 (use an actual space in place [space])

3. Clear wildcards. Search for XXX Replace with nothing.





"Kuko" wrote in message
...

Hi.

I've received six huge (400+ pages) documents from a friend. There
is a typing mistake which appears quite often, and consists in the
fact that the word right after an italic or boldfromatted word are
"attached" to it (i. e., he didn't typed the space). Graphically, the
typing error is the following (being the text enclosed in "_" the
italic or bold formated word):

_blablabla_moreblablabla

The document is full of technical terms, so it is not clever to use
the spell checker. There is a way to search for an "italic+nonitalic"
and "bold+notbold" (without spaces between them) pieces of text? It'll
be nice.

I'm on Word 2000 (SP 3).

TIA



  #3   Report Post  
Doug Robbins
 
Posts: n/a
Default

If your table of contents is a real table of contents (i.e. a field) then if
you update it, it should revert to what it was.

--
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
"Kuko" wrote in message
...
On Fri, 26 Aug 2005 21:57:44 +0200, "Doug Robbins"
wrote:

Hi Doug. Thank you for your interest. The macro is very spectacular
at work. It somewhat separates pieces of text with italic and regular
characters, but for some reason it messed up totally the documents
(which I don't saved LOL), esp. the TOCs and bibliography sections
(which contain a lot of italics).

I uploaded a capture with the result on a TOC at
http://img363.imageshack.us/img363/251/toc8jt.png
Maybe it should help you if you want to fix it. Basically the macro
does what in the image happened to the separator character on the TOC
entries everywhere it sees italic + regular.

Regards



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for straight or curly quotemarks Alan New Users 10 August 5th 05 09:03 AM
Searching for straight or curly quotemarks Alan New Users 0 August 1st 05 10:47 AM
Searching for a character Dave Neve Microsoft Word Help 1 June 22nd 05 02:22 PM
Searching for Batang font Roberta Microsoft Word Help 3 June 17th 05 07:58 PM
Searching for word documents using the open icon is slow? PolarBear Microsoft Word Help 1 June 16th 05 11:29 PM


All times are GMT +1. The time now is 12:35 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"