#1
|
|||
|
|||
Replacing formatted bullet points as a plain text character?
Hi all,
I'm working on a project for work and it entails doing several formatting tricks to a document. I got most of what I wanted up and running, but I'm having one final issue. I need the document to convert a bullet-ed list into plain text and then replace the bullets with a "-". I've used "ActiveDocument.ConvertNumbersToText" which gets me part of the way there, but the code I'm using to replace characters doesn't work for the bullet point. Here is what I'm trying to use. Quote:
|
#2
|
||||
|
||||
You need to test what actual character is being used for the bullet points - ASCII 149 quite possibly isn't correct for your document. Other possibilities, just to name a few, include Unicode 25CF, Symbol 108 from the Wingdings font, Symbols 149-152 from the Wingdings 2 font, etc.
Try clicking on the bullet character and using Insert|Symbol to find which one it is.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I've tried those options and still haven't been able to figure it out yet. When I converted the table to text even when I copied the bullet points and pasted them into the regular Ctrl-F search they still turned up zero results. These are just the standard bullets that are default with Word 2013, I haven't done anything to edit them in any way.
|
#4
|
||||
|
||||
Can you attach an actual document (not just a screenshot) to a post with some sample content so we can exactly what you're working with? You do that via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Can do! Here is the sample text I've been working with.
Additionally here is the full code I'm working with Quote:
|
#6
|
||||
|
||||
Before you can do anything with those particular bullets, you'll need to convert them to manual bullets - right now, they're automatic bullets. Try:
Code:
Sub ReplaceBullets() Dim Para As Paragraph, Rng As Range For Each Para In ActiveDocument.Range.Paragraphs With Para.Range If .Text Like "?" & vbTab & "*" Then Set Rng = .Duplicate With Rng .End = .Start + 2 .Text = vbNullString .InsertBefore Chr(149) & vbTab End With End If End With Next End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Plugged that in and it worked! Thanks so much for your help. I have very limited experience with VBA so I was just kinda jerry rigging my code as I went along. Thanks!
|
Tags |
macro, replace, special characters |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding bullet points to rich text control | dpashley | Word | 1 | 09-21-2016 08:59 AM |
Help With Bullet Points In Powerpoint | Phil_CF | PowerPoint | 2 | 09-10-2016 03:12 AM |
Trouble using bullet points / sub bullet points within Word 2013 | Mr Davo | Word | 2 | 04-18-2016 04:31 PM |
Bullet Points in text boxes | caz46 | PowerPoint | 2 | 11-17-2013 06:18 AM |
Bullet points with text? | jjmclell | Word | 2 | 03-01-2013 11:42 AM |