![]() |
#1
|
|||
|
|||
![]()
I am trying to replace some bullet points in a Word document (using a script). I would like to mention they are not part of a bullet list, they are shown as regular text. In the font box of MS Word, I see "Symbol", and when I go to the 'Insert > Symbol' menu, the listed code number is 183.
I wrote this small script that is supposed to change all these bullets within the current selection. The problem is that it is not working. I select the text, run the script, but it does not change anything. Any idea why, and what else could I try, please? Thank you! Alex Code:
Selection.Find.ClearFormatting With Selection.Find .Text = Chr(183) .Replacement.Text = "-" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll |
#2
|
||||
|
||||
![]()
Can you post a document containing these bullet points?
Select one of the bullets and copy it, then paste this into the find/replace dialog, then record the find/replace as a macro - what do you see in the recorded VBA?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
![]()
> record the find/replace as a macro
Thank you for your suggestion! I recorded a macro and the bullet code is different than the one that was shown in the 'Insert > Symbol' menu. That was 'Chr(183)' and the new one is 'ChrW(61623)'. It is working great now! Below you can see the recorded script. Alex Code:
Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = ChrW(61623) .Replacement.Text = "-" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With Selection.Find.Execute Replace:=wdReplaceAll |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bullet-points Spacing's | France6 | Word | 5 | 02-07-2017 06:08 PM |
![]() |
Mr Davo | Word | 2 | 04-18-2016 04:31 PM |
![]() |
jjmclell | Word | 2 | 03-01-2013 11:42 AM |
Advanced search and replace for bullet points | TishyMouse | Word | 5 | 02-17-2012 06:32 AM |
Bullet points shortcut | OfficeAppentice | Word | 1 | 04-30-2010 04:13 PM |