Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-20-2017, 03:53 PM
onlywonderboy onlywonderboy is offline Replacing formatted bullet points as a plain text character? Windows 7 64bit Replacing formatted bullet points as a plain text character? Office 2013
Novice
Replacing formatted bullet points as a plain text character?
 
Join Date: Feb 2017
Posts: 5
onlywonderboy is on a distinguished road
Default 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:
With Selection.Find


.ClearFormatting
.Text = "•"
.Replacement.ClearFormatting
.Replacement.Text = " - "
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With
This code works for all the other characters I've used it for (®,©,™) but it doesn't seem to want to work for •. Any help would be appreciated, thanks!
Reply With Quote
  #2  
Old 02-20-2017, 05:26 PM
macropod's Avatar
macropod macropod is offline Replacing formatted bullet points as a plain text character? Windows 7 64bit Replacing formatted bullet points as a plain text character? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 02-20-2017, 05:41 PM
onlywonderboy onlywonderboy is offline Replacing formatted bullet points as a plain text character? Windows 7 64bit Replacing formatted bullet points as a plain text character? Office 2013
Novice
Replacing formatted bullet points as a plain text character?
 
Join Date: Feb 2017
Posts: 5
onlywonderboy is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 02-20-2017, 06:03 PM
macropod's Avatar
macropod macropod is offline Replacing formatted bullet points as a plain text character? Windows 7 64bit Replacing formatted bullet points as a plain text character? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #5  
Old 02-21-2017, 09:15 AM
onlywonderboy onlywonderboy is offline Replacing formatted bullet points as a plain text character? Windows 7 64bit Replacing formatted bullet points as a plain text character? Office 2013
Novice
Replacing formatted bullet points as a plain text character?
 
Join Date: Feb 2017
Posts: 5
onlywonderboy is on a distinguished road
Default

Can do! Here is the sample text I've been working with.

Additionally here is the full code I'm working with

Quote:
Sub AsiaNetFormat()
'
' AsiaNetFormat Macro
'

ActiveDocument.ConvertNumbersToText

ActiveDocument.Select
Selection.ClearFormatting

With Selection.Find
.ClearFormatting
.Text = "^0233"
.Replacement.ClearFormatting
.Replacement.Text = " - "
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

With Selection.Find
.ClearFormatting
.Text = "®"
.Replacement.ClearFormatting
.Replacement.Text = "(R)"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

With Selection.Find
.ClearFormatting
.Text = "©"
.Replacement.ClearFormatting
.Replacement.Text = "(C)"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

With Selection.Find
.ClearFormatting
.Text = "™"
.Replacement.ClearFormatting
.Replacement.Text = "(TM)"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

With Selection.Find
.ClearFormatting
.Text = "°"
.Replacement.ClearFormatting
.Replacement.Text = " degrees"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

With Selection.Find
.ClearFormatting
.Text = "£"
.Replacement.ClearFormatting
.Replacement.Text = "pounds "
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

With Selection.Find
.ClearFormatting
.Text = "€"
.Replacement.ClearFormatting
.Replacement.Text = " euros"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

Dim HLnk As Hyperlink
For Each HLnk In ActiveDocument.Hyperlinks
HLnk.Range.InsertAfter " (" & HLnk.Address & ")"

Next

Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing




End Sub

Attached Files
File Type: docx Test 1.docx (13.8 KB, 21 views)
Reply With Quote
  #6  
Old 02-21-2017, 03:13 PM
macropod's Avatar
macropod macropod is offline Replacing formatted bullet points as a plain text character? Windows 7 64bit Replacing formatted bullet points as a plain text character? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #7  
Old 02-21-2017, 03:20 PM
onlywonderboy onlywonderboy is offline Replacing formatted bullet points as a plain text character? Windows 7 64bit Replacing formatted bullet points as a plain text character? Office 2013
Novice
Replacing formatted bullet points as a plain text character?
 
Join Date: Feb 2017
Posts: 5
onlywonderboy is on a distinguished road
Default

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!
Reply With Quote
Reply

Tags
macro, replace, special characters

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing formatted bullet points as a plain text character? 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
Replacing formatted bullet points as a plain text character? Trouble using bullet points / sub bullet points within Word 2013 Mr Davo Word 2 04-18-2016 04:31 PM
Replacing formatted bullet points as a plain text character? Bullet Points in text boxes caz46 PowerPoint 2 11-17-2013 06:18 AM
Replacing formatted bullet points as a plain text character? Bullet points with text? jjmclell Word 2 03-01-2013 11:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft