![]() |
|
#1
|
|||
|
|||
![]()
Hello.
Please follow the directions below to replace text in multiple documents. This is the only solution to replacing text in multiple documents for Microsoft Word. There are several options if you are using another program such as Notepad, etc... 1. Move your mouse cursor to the beginning of the text you wish to copy. Hold the left mouse button and drag the cursor over the text. The text you wish to copy should now be highlighted. 2. Click the right mouse button on the text you wish to copy and select the "Copy" option from the drop-down menu. 3. Select the "-" button in the top right corner of your document to minimize the document in your program. Open the document with the text that you wish to replace by selecting the "File" option in the menu bar and choosing the "Open" option. 4. Move your mouse cursor to the beginning of the text you wish to replace. Hold the left mouse button and drag the cursor over the text. The text you wish to replace should now be highlighted. 5. Click the right mouse button on the text you wish to replace and select the "Paste" option from the drop-down menu. The text you have copied will replace the text you have selected. 6. Repeat steps 3 through 5 if you wish to copy the text to another document. |
#2
|
||||
|
||||
![]() Quote:
Roscoe: Try a macro like: Code:
Sub Update_RTF_File_Sigs() Application.ScreenUpdating = False Dim strFolder As String, strFile As String, RTFDoc strFolder = GetFolder If strFolder = "" Then Exit Sub strFile = Dir(strFolder & "\*.rtf", vbNormal) While strFile <> "" Set RTFDoc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False) With RTFDoc.Range.Find .ClearFormatting .Text = "Old Address" .Replacement.Text = "New Address" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = True .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll End With RTFDoc.Close SaveChanges:=True strFile = Dir() Wend Set RTFDoc = Nothing Application.ScreenUpdating = True End Sub Function GetFolder() As String Dim oFolder As Object GetFolder = "" Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0) If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path Set oFolder = Nothing End Function Of course, you'll need to change the 'Old Address' & 'New Address' details to suit your requirements. In this regard, if an address is in the form of: Address Line 1¶ Address Line 2 the .Text and/or .Replacement.Text expressions (as required), would become: = "Address Line 1^pAddress Line2" In case you need advide on how to install & run a macro, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] Last edited by macropod; 01-28-2011 at 02:17 AM. Reason: Deleted unnecessary message box (left over from testing) |
#3
|
|||
|
|||
![]()
Hi,
Thank you so much macropod ! This script is exactly what I am looking for. Would it be possible to also check in all sub-directories of the selected folders ? That would be amazing. Thank you ! ~Pat |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replace All with plain text containing subscript | DeaducK | Word | 0 | 06-24-2010 08:16 PM |
Replace formatting with text | eyehefbee | Word | 2 | 11-09-2009 02:41 AM |
![]() |
themangoagent | Word | 2 | 08-14-2009 12:12 PM |
2007 merging multiple documents into one master | hugheso | Word | 0 | 04-02-2009 04:31 AM |
![]() |
reitdesign | Word | 3 | 12-12-2008 11:55 AM |