PDA

View Full Version : Macro to Look for special characters



austenr
03-28-2006, 01:23 PM
Hi,

My word macro skills are practically nill so I am soliciting help. I have a large document that I want to search for a bullet. If found I need to do two carriage returns. Thanks. :dunno

TonyJollans
03-28-2006, 01:50 PM
Would that be a particular type of bullet? And would it be in open text or as the bullet in a bulleted list?

mdmackillop
03-28-2006, 01:52 PM
Hi Austen
Can you post a bit of your document?
Regards
Malcolm

austenr
03-28-2006, 02:12 PM
Hi Malcolm,


The whole file is a big long string of text with the bullet to the left as an example intersperced. I copied and pasted to Word from Acrobat reader. Even with the copy option of keeping the formatting it really messed it up.the text is like this:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccccccccccccccccccccccc



Cant really post it because it is mostly sensitive data. Sorry.

Thanks

TonyJollans
03-28-2006, 04:13 PM
If this is bullets as formatting what about ..

Ctrl+A to Select All
Format > Bullets and Numbering > Bullets tab
Click on "None"

fumei
03-28-2006, 07:06 PM
Why not just copy the bullet, go to Replace, put in the bullet, and replace with ^p^p?

Mind you, you may want to do a macro record of that so you can use it again.

austenr
03-29-2006, 06:46 AM
Gerry,

How do you get the bullet in the find box?

JohnnyBravo
07-19-2006, 08:15 AM
Austenr, I'm working on a similar problem but I'm trying to the reverse of your situation.

I know this is an old thread and you may have already found your solution, but I see no one came back to answer your question. Besides, I'm still learning the ropes in VBA, I thought I might revive this discussion atleast for the sake of learning a few things.

Could the following macro work? It seems the character number is very precise so if you have a bullet point that is this (o) big, as opposed to this (O) big, you would need to find the exact corresponding character number in your document. But how you would go about finding that - I have no idea.

Sub FindBullets_ReplaceRecorded()
'
' FindBullets_Replace Macro
' Macro recorded 7/11/2006 by John
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Symbol CharacterNumber:=9679, Unicode:=True
.Forward = True
.Replacement = ^p^p
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

mdmackillop
07-19-2006, 01:03 PM
Dont forget the Font size. That may help distinguish them.