#1
|
|||
|
|||
Modifying RTF File in MS Word 2007
I'm editing several RTF ebooks. I need to reformat by executing a fixed sequence of changes to the total file. For example.
Change all "TAB" characters to null then Change all "-" characters to null then Change all "PARAGRAPH" character + one SPACE to "~" etc. I'm new to VBA, but experienced in Xbase programming. I've reviewed different examples but remain confused. An example for executing a set of fixed sequence changes would be most appreciated. |
#2
|
|||
|
|||
Please ignore post. Figured out how to use Macro record and solved problem.
|
#3
|
||||
|
||||
This can all be done via two wildcard Find/Replace executions:
1. Find = [^t\-] Replace = nothing 2. Find = ^13^32 Replace = ~ The equivalent macro would be: Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Format = False .Forward = True .Wrap = wdFindContinue .MatchWildcards = True .Text = "[^t\-]" .Replacement.Text = "" .Execute Replace:=wdReplaceAll .Text = "^13^32" .Replacement.Text = "~" .Execute Replace:=wdReplaceAll End With End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Title bar in word and ecxel 2010 is not picking up greek file name of 2007 file | danielle | Word | 4 | 12-03-2014 07:47 AM |
Modifying list styles in word | dreamz | Word | 1 | 06-30-2014 12:03 PM |
Modifying an existing table in Word | janewayb | Word Tables | 1 | 04-08-2013 06:17 PM |
modifying a PST file | ctspwc | Outlook | 5 | 11-17-2010 09:29 PM |
Creating Scatter XY chart in Excel 2007, modifying the Y axsis | niss3 | Excel | 1 | 10-27-2010 07:41 PM |