![]() |
|
#1
|
|||
|
|||
![]()
I have 27 documents which need editing. In each of them, there is a style applied to parts throughout the document. It is italicized and red. Because of the conversion I must do to translate it into a database, I need to make all the paragraph breaks into line breaks. The problem is that when I do that, every bit of the text becomes italicized.
Is there a way to replace the paragraph breaks (^p) with line breaks (^l) and not have the formatting automatically change? I still want the original color and italics to stay, but I don't want them to spread to the rest of the document. I would completely remove the style from each section, but that would cause me to have to go back through the entire document and manually re-italicize each part. Help? |
#2
|
||||
|
||||
![]()
Hi Cobb,
You can achieve that by saving the document as an RTF file, then opening it in WordPad. Make an edit of any kind in WordPad, then re-save the file. When you re-open the file in Word, all the content will then have the 'Normal' Style applied, with direct formatting to create the character effects. You can then delete the paragraph breaks without any character format changes.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Hot Dog! That just saved me an absolute boatload of time with the rest of my fixes. Thank you so very, very much!
|
#4
|
|||
|
|||
![]()
well...ok, now that created another problem. All my footnote references are gone. I think I can rearrange my steps to make that irrelevant.
|
#5
|
||||
|
||||
![]()
That'll be because WordPad doesn't support footnotes ...
What you can do is unlink the footnotes before converting to RTF, using the following macro: Code:
Sub UnLinkNotes() Application.ScreenUpdating = False Dim nRng As Range, fNote As Footnote, nRef As String With ActiveDocument For Each fNote In .Footnotes With fNote With .Reference.Characters.First .InsertAfter "]" .Characters.Last.Font.Superscript = True .Collapse wdCollapseStart .InsertCrossReference wdRefTypeFootnote, wdFootnoteNumberFormatted, fNote.Index nRef = .Characters.First.Fields(1).Result .Characters.First.Fields(1).Unlink .InsertBefore "[" .Characters.First.Font.Superscript = True End With .Range.Cut End With Set nRng = .Range With nRng .Collapse wdCollapseEnd .End = .End - 1 If .Characters.Last <> Chr(12) Then .InsertAfter vbCr .InsertAfter nRef & " " With .Paragraphs.Last.Range .Style = "Footnote Text" .Words.First.Style = "Footnote Reference" End With .Collapse wdCollapseEnd .Paste If .Characters.Last = Chr(12) Then .InsertAfter vbCr End With Next For Each fNote In .Footnotes fNote.Delete Next End With Set nRng = Nothing Application.ScreenUpdating = True End Sub Code:
Sub ReLinkFootNotes() Dim i As Integer, j As Integer, k As Integer, l As Integer, FtRng As Range Application.ScreenUpdating = False With ActiveDocument Set FtRng = Selection.Range With FtRng .Style = "Footnote Text" With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "\[([0-9]{1,})\]" .Replacement.Text = "\1" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With k = .Paragraphs(1).Range.Words(1) - 1 j = k l = ActiveDocument.Footnotes.Count - k For i = 1 To .Paragraphs.Count If .Paragraphs(i).Range.Words(1) = j + 1 Then j = j + 1 End If Next i End With For i = k + 1 To j StatusBar = "Finding Footnote Location: " & i + l With .Content.Find .Text = "[" & i & "]" .Font.Superscript = True .MatchWholeWord = True .MatchWildcards = False .Execute If .Found = True Then .Parent.Select With Selection .Delete .Footnotes.Add Range:=Selection.Range, Text:="" End With End If End With Next i With FtRng For i = k + 1 To j StatusBar = "Transferring Footnote: " & i + l With .Paragraphs(1).Range .Cut With ActiveDocument.Footnotes(i + l).Range .Paste .Words(1).Delete .Characters.Last.Delete End With End With Next i On Error Resume Next End With Set FtRng = Nothing End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
![]()
When I saved as an RTF, made a change and resaved and RTF, it STILL retained Heading Styles. So I tried ODT and that worked.
Also, there are some Macro Packages out there like Payne, Softwise (now called Innova), Legal MacPac, LegalBar, etc. that have a button that quickly converts all styles to direct formatting. I *thought* that there was a feature in Word that would strip the styles, just like it can strip other metadata in a document. I looked but can't find it. So without a purchased macro package, I don't think Word has anything to do it natively. Microsoft Fail. |
#7
|
||||
|
||||
![]()
Hi CharlzNine,
Your reply suggests you didn't do as the advice given to Cobb78 suggested, which entailed making an edit with WordPad. As for the other macro packages, you're welcome to use them if that's what you prefer. Your belief that Word could strip all Styles shows a basic lack of understanding of how Word works. Every document must use at least one Style (typically, Normal). The foregoing discussion in this thread shows how it can be done without "a purchased macro package".
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
![]()
You are correct, an edit does have to be made. However I did that. For the RTF, it still kept the heading styles. But when I used the ODT format, it all got put to the Normal style. Exactly what we wanted. I didn't have footnotes in my document, but i'm sure the macro will work. I'll test it out tomorrow. To clarify, they should first be converted to end notes, correct?
Not sure if this could be a factor, but I'm using 2010 32 bit. |
#9
|
||||
|
||||
![]()
No, you don't need to convert the footnotes to endnotes. If you do so, the code won't work. The first macro does all the processing that is required.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
![]()
My problem was this: I needed to copy one document into another document, the latter containing a TOC. However while I wanted to preserve the formatting, I didn't want to copy over the style information as that was creating unnecessary entries in the TOC.
What I found was that after saving the document as RTF, opening it in Wordpad, making a change and re-saving it as suggested by Macropod, MS Word still retained style information. It seems that Word has a smart way of figuring out which style particular text should use. So I followed Charlznine's reco and opened the RTF in OpenOffice and copied over the text as desired. Presto! ![]() Thanks to both Macropod and Charlznine for this |
#11
|
|||
|
|||
![]()
I had this problem and found this forum whilst looking for the answer. I solved it like this:
Format painter will only transfer styles if you select a paragraph marker. If you want to keep the font style but not the paragraph style, select a word in the paragraph and then use format painter on the text taht you want to change (without changing the style). |
#12
|
||||
|
||||
![]()
Hi bijanrf,
That's not much use if you need to replicate paragraph formats as well. PS: Please don't resurrect old threads - this one was last active nearly two years ago.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ennuipreneur | Outlook | 2 | 05-29-2012 08:56 AM |
Strange formatting - unable to remove. | Kaem | Word | 3 | 03-01-2012 09:31 AM |
![]() |
ChuckR | Word | 3 | 01-26-2012 11:52 AM |
![]() |
faithhealer | Word | 1 | 11-30-2011 02:40 PM |
![]() |
Rose | Word | 2 | 05-30-2010 04:12 AM |