Discussion:
reset font format to default but keep the bold formatting..>>
(too old to reply)
michiel
2006-03-07 12:34:38 UTC
Permalink
hello, I'm looking for a way to remove all font formatting from a Word
document except the bold. Appreciate any suggestions. Thanks, Michiel
Jezebel
2006-03-07 13:48:34 UTC
Permalink
1. Define a character style called maybe "BoldText". The actual style
features are irrelevant -- it's only the name you need. Not that it must be
a *character* style, not a paragraph style.

2. Use Find and Replace. Leave the Find box blank and set the format to Font
Bold. Leave the Replace box blank and set the format to Style =
"BoldText". Click Replace All.

3. Select the entire document and reset the styles: Ctrl-A Ctrl-Q
Ctrl-Space.

4. Use the above Find and Replace in reverse: Find format > Style =
"BoldText", Replace with format > Font > bold.

5. Delete the "BoldText" style.
hello, I'm looking for a way to remove all font formatting from a Word
document except the bold. Appreciate any suggestions. Thanks, Michiel
michiel
2006-03-07 14:30:34 UTC
Permalink
thanks, but that doesn't really work. Problem is that by clearing the format
thru ctrl+q and ctrl+space, you also delete the boldtext style so that the
second find and replace doesn't work anymore. But thanks for taking the time
to respond to my question!
Post by Jezebel
1. Define a character style called maybe "BoldText". The actual style
features are irrelevant -- it's only the name you need. Not that it must be
a *character* style, not a paragraph style.
2. Use Find and Replace. Leave the Find box blank and set the format to Font
Bold. Leave the Replace box blank and set the format to Style =
"BoldText". Click Replace All.
3. Select the entire document and reset the styles: Ctrl-A Ctrl-Q
Ctrl-Space.
4. Use the above Find and Replace in reverse: Find format > Style =
"BoldText", Replace with format > Font > bold.
5. Delete the "BoldText" style.
hello, I'm looking for a way to remove all font formatting from a Word
document except the bold. Appreciate any suggestions. Thanks, Michiel
Klaus Linke
2006-03-25 12:02:40 UTC
Permalink
Hi Michiel,

Two snags:
-- Bold may be applied by styles.
-- If you have a bold style and something in that has been unbolded, you
likely don't want to loose that either?

You could
-- tag bold text first (Find/Replace "Font = bold" with <b>^&</b>),
(both bold from styles and manual bolding will be tagged)
-- reset the font,
-- remove all bold formatting (say by replacing "bold" with "not bold"),
-- then replace (using "Match wildcards"):
Find what: \<b\>(*)\</b\>
Replace with: \1 ((+ Format > Font = bold))

-- Finally save the doc before you work further on it. You'll have applied
manual bold formatting to all bold styles (headings?...).
A Save will enable Word to clean that unnecessary formatting up.

Greetings,
Klaus
Post by michiel
thanks, but that doesn't really work. Problem is that by clearing the format
thru ctrl+q and ctrl+space, you also delete the boldtext style so that the
second find and replace doesn't work anymore. But thanks for taking the time
to respond to my question!
Post by Jezebel
1. Define a character style called maybe "BoldText". The actual style
features are irrelevant -- it's only the name you need. Not that it must be
a *character* style, not a paragraph style.
2. Use Find and Replace. Leave the Find box blank and set the format to Font
Bold. Leave the Replace box blank and set the format to Style =
"BoldText". Click Replace All.
3. Select the entire document and reset the styles: Ctrl-A Ctrl-Q
Ctrl-Space.
4. Use the above Find and Replace in reverse: Find format > Style =
"BoldText", Replace with format > Font > bold.
5. Delete the "BoldText" style.
hello, I'm looking for a way to remove all font formatting from a Word
document except the bold. Appreciate any suggestions. Thanks, Michiel
Helmut Weber
2006-03-25 14:42:31 UTC
Permalink
Hi Klaus,

how about this one,
coded with respect to speed
and with respect to avoiding repagination by inserting tags,
at least to some extend.

I think in principle it could be used in quite a variety of cases:

Sub test000()
Dim oPrg As Paragraph
Dim rWrd As Range
Dim rChr As Range
For Each oPrg In ActiveDocument.Paragraphs
If oPrg.Range.Font.Bold = False Then
oPrg.Range.Font.Reset
ElseIf oPrg.Range.Font.Bold = True Then
oPrg.Range.Font.Reset
oPrg.Range.Font.Bold = True
ElseIf oPrg.Range.Font.Bold = 9999999 Then
For Each rWrd In oPrg.Range.Words
If rWrd.Font.Bold = False Then
rWrd.Font.Reset
ElseIf rWrd.Font.Bold = True Then
rWrd.Font.Reset
rWrd.Font.Bold = True
ElseIf rWrd.Font.Bold = 9999999 Then
For Each rChr In rWrd.Characters
If rChr.Font.Bold = True Then
rChr.Font.Reset
rChr.Font.Bold = True
ElseIf rChr.Font.Bold = False Then
rChr.Font.Reset
End If
Next
End If
Next
End If
Next
End Sub


I am not sure, whether formatting something as bold,
which is bold anyway, may cause problems sometime.
--
Gruß aus Landsberg am Lech

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Klaus Linke
2006-03-25 20:06:35 UTC
Permalink
Hi Helmut,

Interesting approach, looks well optimized! Though 3 replacements and
"FontReset" on the whole doc is likely pretty fast, too...
Not sure what program would "win".

It might depend on the specifics of the document (how large? how much bold
text? ...).

Regards,
Klaus
Post by Helmut Weber
Hi Klaus,
how about this one,
coded with respect to speed
and with respect to avoiding repagination by inserting tags,
at least to some extend.
Sub test000()
Dim oPrg As Paragraph
Dim rWrd As Range
Dim rChr As Range
For Each oPrg In ActiveDocument.Paragraphs
If oPrg.Range.Font.Bold = False Then
oPrg.Range.Font.Reset
ElseIf oPrg.Range.Font.Bold = True Then
oPrg.Range.Font.Reset
oPrg.Range.Font.Bold = True
ElseIf oPrg.Range.Font.Bold = 9999999 Then
For Each rWrd In oPrg.Range.Words
If rWrd.Font.Bold = False Then
rWrd.Font.Reset
ElseIf rWrd.Font.Bold = True Then
rWrd.Font.Reset
rWrd.Font.Bold = True
ElseIf rWrd.Font.Bold = 9999999 Then
For Each rChr In rWrd.Characters
If rChr.Font.Bold = True Then
rChr.Font.Reset
rChr.Font.Bold = True
ElseIf rChr.Font.Bold = False Then
rChr.Font.Reset
End If
Next
End If
Next
End If
Next
End Sub
I am not sure, whether formatting something as bold,
which is bold anyway, may cause problems sometime.
--
Gruß aus Landsberg am Lech
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
michiel
2006-03-26 22:51:44 UTC
Permalink
Post by Helmut Weber
Hi Klaus,
how about this one,
coded with respect to speed
and with respect to avoiding repagination by inserting tags,
at least to some extend.
Sub test000()
Dim oPrg As Paragraph
Dim rWrd As Range
Dim rChr As Range
For Each oPrg In ActiveDocument.Paragraphs
If oPrg.Range.Font.Bold = False Then
oPrg.Range.Font.Reset
ElseIf oPrg.Range.Font.Bold = True Then
oPrg.Range.Font.Reset
oPrg.Range.Font.Bold = True
ElseIf oPrg.Range.Font.Bold = 9999999 Then
For Each rWrd In oPrg.Range.Words
If rWrd.Font.Bold = False Then
rWrd.Font.Reset
ElseIf rWrd.Font.Bold = True Then
rWrd.Font.Reset
rWrd.Font.Bold = True
ElseIf rWrd.Font.Bold = 9999999 Then
For Each rChr In rWrd.Characters
If rChr.Font.Bold = True Then
rChr.Font.Reset
rChr.Font.Bold = True
ElseIf rChr.Font.Bold = False Then
rChr.Font.Reset
End If
Next
End If
Next
End If
Next
End Sub
I am not sure, whether formatting something as bold,
which is bold anyway, may cause problems sometime.
--
Gruß aus Landsberg am Lech
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
michiel
2006-03-26 22:50:46 UTC
Permalink
Post by Klaus Linke
Hi Michiel,
-- Bold may be applied by styles.
-- If you have a bold style and something in that has been unbolded, you
likely don't want to loose that either?
You could
-- tag bold text first (Find/Replace "Font = bold" with <b>^&</b>),
(both bold from styles and manual bolding will be tagged)
-- reset the font,
-- remove all bold formatting (say by replacing "bold" with "not bold"),
Find what: \<b\>(*)\</b\>
Replace with: \1 ((+ Format > Font = bold))
-- Finally save the doc before you work further on it. You'll have applied
manual bold formatting to all bold styles (headings?...).
A Save will enable Word to clean that unnecessary formatting up.
Greetings,
Klaus
Post by michiel
thanks, but that doesn't really work. Problem is that by clearing the format
thru ctrl+q and ctrl+space, you also delete the boldtext style so that the
second find and replace doesn't work anymore. But thanks for taking the time
to respond to my question!
Post by Jezebel
1. Define a character style called maybe "BoldText". The actual style
features are irrelevant -- it's only the name you need. Not that it must be
a *character* style, not a paragraph style.
2. Use Find and Replace. Leave the Find box blank and set the format to Font
Bold. Leave the Replace box blank and set the format to Style =
"BoldText". Click Replace All.
3. Select the entire document and reset the styles: Ctrl-A Ctrl-Q
Ctrl-Space.
4. Use the above Find and Replace in reverse: Find format > Style =
"BoldText", Replace with format > Font > bold.
5. Delete the "BoldText" style.
hello, I'm looking for a way to remove all font formatting from a Word
document except the bold. Appreciate any suggestions. Thanks, Michiel
Loading...