Find/replace in all open documents Thread poster: Tom in London
| Tom in London United Kingdom Local time: 15:13 Member (2008) Italian to English
One of the most useful features of Office 2008 for Mac was that you could find/replace a word or phrase in "all open documents". That feature was removed in Office 2011, nor is there any sign of it coming back in the new Office 2015 (of which I have a test copy). For that reason I am still using Office 2008 for Mac, but it's getting old now and I'm wondering if anyone knows of either an Office-compatible application that has "find/replace in all open documents" or a th... See more One of the most useful features of Office 2008 for Mac was that you could find/replace a word or phrase in "all open documents". That feature was removed in Office 2011, nor is there any sign of it coming back in the new Office 2015 (of which I have a test copy). For that reason I am still using Office 2008 for Mac, but it's getting old now and I'm wondering if anyone knows of either an Office-compatible application that has "find/replace in all open documents" or a third-party tweak (one that's easy to use) that does the same job? I know about the other option (concatenating multiple files so that find/replace is only applied to one file- that's not always a practical way of doing it).
[Edited at 2015-06-01 16:28 GMT] ▲ Collapse | | | 2nl (X) Netherlands Local time: 16:13 "There's a macro for that" | Jun 1, 2015 |
You can use a macro for that, if you'd be willing to install it. I could give you further instructions then. | | | Tom in London United Kingdom Local time: 15:13 Member (2008) Italian to English TOPIC STARTER
2nl wrote: You can use a macro for that, if you'd be willing to install it. I could give you further instructions then. Please do! | | | 2nl (X) Netherlands Local time: 16:13 Quick and dirty solution in VBA | Jun 1, 2015 |
Here's a movie: http://youtu.be/9F796GWCoKU And here is the VBA code that you'll need: Dim doc As Word.Document Dim strFind As String Dim strReplace As String strFind = InputBox("Type the string to find", "Enter your text", "Anton") strReplace = InputBox("Type the string to use for replacement", "Enter your text", "Johann") For... See more Here's a movie: http://youtu.be/9F796GWCoKU And here is the VBA code that you'll need: Dim doc As Word.Document Dim strFind As String Dim strReplace As String strFind = InputBox("Type the string to find", "Enter your text", "Anton") strReplace = InputBox("Type the string to use for replacement", "Enter your text", "Johann") For Each doc In Word.Documents doc.Select For Each myRange In ActiveDocument.StoryRanges Selection.Find.ClearFormatting With Selection.Find .Text = strFind .Replacement.Text = strReplace .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Replace:=wdReplaceAll Next myRange Next Start Word:mac 2011. Copy the code above. Create a new macro, e.g. 'findall'. Inside the macro paste the text of the macro above. So you'll get: Sub findall() ' ' findall Macro ' ' Dim doc As Word.Document Dim strFind As String Dim strReplace As String strFind = InputBox("Type the string to find", "Enter your text", "Anton") strReplace = InputBox("Type the string to use for replacement", "Enter your text", "Johann") For Each doc In Word.Documents doc.Select For Each myRange In ActiveDocument.StoryRanges Selection.Find.ClearFormatting With Selection.Find .Text = strFind .Replacement.Text = strReplace .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Replace:=wdReplaceAll Next myRange Next End Sub Save and exit the macro editor. Run the macro in Word (Tools > Macro > Macros). Note that this macro is quick and dirty. It only replaces in the main text. ▲ Collapse | |
|
|
Tom in London United Kingdom Local time: 15:13 Member (2008) Italian to English TOPIC STARTER Thanks but.... | Jun 1, 2015 |
...looks complicated ! | | | 2nl (X) Netherlands Local time: 16:13 Yes, but it IS simple | Jun 1, 2015 |
Tom in London wrote: ...looks complicated ! Perhaps it looks complicated, but it actually is very simple. A couple of clicks only. Don't be afraid. Why not give it a try? | | | Tom in London United Kingdom Local time: 15:13 Member (2008) Italian to English TOPIC STARTER
2nl wrote: Tom in London wrote: ...looks complicated ! Perhaps it looks complicated, but it actually is very simple. A couple of clicks only. Don't be afraid. Why not give it a try? OK and thanks- I'll give it a try when I get a free moment | | | achisholm United Kingdom Local time: 15:13 Italian to English + ...
Let me know how you get on. I use Office 2011 and it would be useful to know. Back in my PC days, I had a concordance search/replace app which was very simple to use and anything that could do similar on a Mac would be a boon. | |
|
|
2nl (X) Netherlands Local time: 16:13 There's nothing that you can ruin | Jun 2, 2015 |
Alexander Chisholm wrote: Let me know how you get on. I use Office 2011 and it would be useful to know. Back in my PC days, I had a concordance search/replace app which was very simple to use and anything that could do similar on a Mac would be a boon. There's nothing that you can ruin by installing a simple macro in Word. You can find more info here: http://tinyurl.com/q8ycrg4 This link will open a PDF from Microsoft. However, the route shown in the video is simpler. | | | Tom in London United Kingdom Local time: 15:13 Member (2008) Italian to English TOPIC STARTER
2nl wrote: There's nothing that you can ruin by installing a simple macro in Word. I know, but for now I'm happy with Word 2008, which still runs fine in Yosemite and in fact crashes LESS frequently than Word 2011. But I'll have a go with the macro when I feel like playing around. In the meantime you could dress it up in a fancy GUI, give it an amusing name, and start selling it! You'd be rich! Everybody wants a macro like this ! I only want 49% !
[Edited at 2015-06-02 09:55 GMT] | | | The easy way... | Jun 2, 2015 |
... for files in one or more known location(s), both open and err, not open. Run TextWrangler (download it here, it doesn't cost any money, and you'll need it anyway at some point) In the menu, go to Search | Multiple-File Search..., select the location, and enter the terms In the pop-up screen, select if you only want to save the changes in the open files or not That's it. The advantage is, that it works for all document file formats, not only *.docx. The disadvantage as compared to 2nl's macro, is that it requires running an extra app, TextWrangler. There are several other ways to do it (Terminal commands, for example), but the macro and the TextWrangler ways seem to me the easiest. Cheers, Hans | | | Tom in London United Kingdom Local time: 15:13 Member (2008) Italian to English TOPIC STARTER Doesn't work for me | Jun 2, 2015 |
Hans - I've tried TExt Wranger and it doesn't work for me. Not only is a simple 2-word phrase not found/ not replaced but the open Word files in which the 2-word phrase occurs are transformed into OpenXML files and can no longer be opened ! What am I doing wrong? | |
|
|
simple 2-word phrase not found/ not replaced It does work, but to see the change you'll have to go to the saved file. I think this workflow wasn't intended for open documents, but it works anyway. I wonder how 2nl's macro works (I don't use VBA, too Microsoft for me). transformed into OpenXML files and can no longer be opened That's because the text part of the *.docx file is XML. If you're curious, just change the extension into *.zip, and unzip. You'll see a file called something like [Content_Types].xml. I'm sure you can open the *.docx file after the S/R. Cheers, Hans | | |
I claimed the TextWrangler approach worked, and it does. But unlike I'm overlooking something, something will go wrong if you make a change in the frontmost document other than an S&R. If you save that document, you'll "undo" the S&R actions. I think. On the other hand, why would all the other documents be open? Probably to allow for S&R... And the procedure mentioned above is perfect for non-open (closed? sounds strange to me) documents, or for open documents and open and non-open ... See more I claimed the TextWrangler approach worked, and it does. But unlike I'm overlooking something, something will go wrong if you make a change in the frontmost document other than an S&R. If you save that document, you'll "undo" the S&R actions. I think. On the other hand, why would all the other documents be open? Probably to allow for S&R... And the procedure mentioned above is perfect for non-open (closed? sounds strange to me) documents, or for open documents and open and non-open documents that only need S&R. Cheers, Hans ▲ Collapse | | | 2nl (X) Netherlands Local time: 16:13 Better use CafeTran | Jun 2, 2015 |
Tom in London wrote: But I'll have a go with the macro when I feel like playing around. In the meantime you could dress it up in a fancy GUI You'd better give CafeTran a try. It can Find and Replace 2000 instances of a word in 30000 segments in 1000 files in 2 seconds. And it adjusts case automatically. But indeed, it doesn't have a Word interface. Next week I'll schedule a training in The Draft House Tower Bridge. Perhaps you want to attend? | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Find/replace in all open documents TM-Town | Manage your TMs and Terms ... and boost your translation business
Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.
More info » |
| Anycount & Translation Office 3000 | Translation Office 3000
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |