1. Macro to find and replace paragraph markers with tabs
Hi
I'm trying to convert several tables in Word 2003 to standard tabbed text so
I can import it into Excel.
I've recorded a macro that converts the table to text seperated by tabs but
then I need to replace the remainder paragraphs with tabs. Recording the
macro goes OK.
The table gets converted and the text is still selected so Find, Replace ^p
with ^t and I get asked to check all the doc after it's replaced the
selection, I say No and close the dialog box. When I run the macro it
converts ALL paras to tabs and not just the selection. This is the macro I've
recorded. Am I missing something??
Many thanks
Ian
Sub Macrotable()
'
'
' Macro recorded 01/06/2009 by me
'
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.ConvertToTable Separator:=wdSeparateByDefaultListSeparator, _
NumColumns:=3, NumRows:=1, AutoFitBehavior:=wdAutoFitFixed
With Selection.Tables(1)
.Style = "Table Grid"
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = True
End With
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.Tables(1).Select
Selection.Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:= _
True
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = "^t"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Selection.Find.Execute Replace:=wdReplaceAll
End With
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub
2. Find and Replace Paragraphs - MS Word&VBA
3. Find and Replace Paragraphs - better explanation
I have to loop through numerous documents in a directory and find and replace paragraphs. I plan on having one open documnet with two paragraphs, the first paragraph is the one to find, the second is the one to replace. Next I need to open the other documents and iterate through the paragraphs. If the paragraph text equals the first paragraph in the original document, I would like to replace it with the second paragraph in the original document. Does anybody have an example of searching for one paragraph and replacing the text of it with the text of another paragraph?
5. How to Find a 'Printing' Paragraph symbol using 'Find & Replace'
A 'printing' paragraph symbol cannot be pasted in the Find or Replace fields. Does anyone know the code for a 'printing' paragraph symbol that can work in the Find and Replace fields? Regards, AN
6. find & replace but don't replace one character in find
7. BUG REPORT - Paragraph mark in Find & Replace
There is a bug in Office Word 2007 12.0.4518.1014. Description: "^v" is inserted instead of "^p" into the Find Word field of Find & Replace screen when Pragraph Character is selected from the Special pull-down button. Occurs: Always Steps to reproduce: 1. Open Find & Replace window (eg press Control+H) 2. Select either Find or Replace Tab 3. Press More >> button if required, to see the bottom panel 4. Ensure all tickboxes are un-ticked 5. Focus on the Find What field 6. Click on the Special pull-down button and select Paragraph Character from the list. Not sure where to submit this bug to. Someone please confirm this bug, so Microsoft techies take notice.
8. "Paragraph character" in find and replace - MS Word Support