Return-Path: X-Original-To: apmail-incubator-ooo-users-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E9C0DBAB for ; Tue, 17 Jul 2012 17:07:01 +0000 (UTC) Received: (qmail 42263 invoked by uid 500); 17 Jul 2012 17:07:01 -0000 Delivered-To: apmail-incubator-ooo-users-archive@incubator.apache.org Received: (qmail 42208 invoked by uid 500); 17 Jul 2012 17:07:01 -0000 Mailing-List: contact ooo-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-users@incubator.apache.org Delivered-To: mailing list ooo-users@incubator.apache.org Received: (qmail 42195 invoked by uid 99); 17 Jul 2012 17:07:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 17:07:01 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [167.206.4.198] (HELO mta3.srv.hcvlny.cv.net) (167.206.4.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 17:06:53 +0000 Received: from [192.168.1.102] (ool-44c323a8.dyn.optonline.net [68.195.35.168]) by mta3.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <0M7B00LCUE6URF90@mta3.srv.hcvlny.cv.net> for ooo-users@incubator.apache.org; Tue, 17 Jul 2012 13:06:31 -0400 (EDT) Date: Tue, 17 Jul 2012 13:06:30 -0400 From: Doug Subject: Re: Macro or its equivalent to replace double spaces with single space. In-reply-to: <20120717120658.9e697878b28fb8762ff785b8@iol.ie> To: ooo-users@incubator.apache.org Message-id: <50059B96.8030001@optonline.net> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8BIT References: <5004C8DF.5030208@casaerwin.org> <991381645030483ABDAF4FF028EB6F89@SAI> <20120717120658.9e697878b28fb8762ff785b8@iol.ie> User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120508 Thunderbird/12.0.1 X-Virus-Checked: Checked by ClamAV on apache.org On 07/17/2012 07:06 AM, Rory O'Farrell wrote: > On Tue, 17 Jul 2012 12:47:01 +0200 > Johnny Rosenberg wrote: > >> 2012/7/17 Srinivasulu Bhattaram: >>> I am new to Open Office. >>> InWORD 2003 (and also in WORD 2007), >>> I have craeted macros to remove double spaces with single spaces and used >>> them extensively.. >>> How to have an equivalent of it in Open Office writer? >>> >>> I do not want to go through Find Replace.... kind of thing. >>> seena >> What about letting a macro do the search and replace for you? >> >> I just wrote this one, with inspiration from ”Useful Macro Information >> For OpenOffice.org By Andrew Pitonyak”, which is a PDF that you can >> download somewhere: >> >> REM ***** BASIC ***** >> >> Sub RemoveRedundantSpaces >> Dim oReplace as object >> oReplace = ThisComponent.createReplaceDescriptor() >> >> With oReplace >> .SearchString = " " >> .ReplaceString = " " >> End With >> >> While ThisComponent.ReplaceAll(oReplace)>0 >> Wend >> End Sub >> >> >> This macro also takes care of tripple spaces and… well, it just >> removes all spaces until there are only single spaces left. And it is >> fast. Really fast. >> I tested it myself, and it worked in all my test cases. Well, I didn't >> test it THAT thoroughly, but still… >> >> Much better than using the crappy macro recorder anyway. And shorter… >> >> If you write the documents yourself, there is a simple way to prevent >> double spaces in the first place, something like: >> Tools → Options for auto correction… → Click the Options tab → ☒ >> Ignore double spaces >> >> You can still make double spaces if you really want to, but it's less >> likely to happen accidently. >> >> >> Kind regards >> >> Johnny Rosenberg >> ジョニー・ローゼンバーグ >> > Or why not use the Language Tool extension, which will flag double spaces as you type with a blue wiggly underline? > That wouldn't help with text that is already written, that you're editing. --doug -- Blessed are the peacekeepers...for they shall be shot at from both sides. --A.M. Greeley --------------------------------------------------------------------- To unsubscribe, e-mail: ooo-users-unsubscribe@incubator.apache.org For additional commands, e-mail: ooo-users-help@incubator.apache.org