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 43C2DCE8B for ; Tue, 17 Jul 2012 11:14:38 +0000 (UTC) Received: (qmail 47829 invoked by uid 500); 17 Jul 2012 11:14:37 -0000 Delivered-To: apmail-incubator-ooo-users-archive@incubator.apache.org Received: (qmail 47458 invoked by uid 500); 17 Jul 2012 11:14:35 -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 47397 invoked by uid 99); 17 Jul 2012 11:14:35 -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 11:14:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gurus.knugum@gmail.com designates 209.85.212.47 as permitted sender) Received: from [209.85.212.47] (HELO mail-vb0-f47.google.com) (209.85.212.47) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 11:14:29 +0000 Received: by vbbfr13 with SMTP id fr13so160298vbb.6 for ; Tue, 17 Jul 2012 04:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=FcwgylLcIOSl6JLXFKgNtmCk87hbpcHAj3KxItwVrG8=; b=deH8R1NNgFAtBnw+WCzV1v2DnAHtEMpm0JjlOqCCDenRW1XCB+Bysiqmt0HE4O09NI njMYTp8VyCDHfbAHnUrXTr5slqmIhJDKCEfjoaTv8QjB1AZvpvZ9AzTDWgY6C0cIQVPV D+mVx/TQAeB1Pt9ZIaUE48H+MwuJq8LBsNHWre2XVlgAvvrq48qi9IN4pGTckjF8yNI8 Q+wk6xG8Zt+Q7ELbAcynb+uyvlwvdGebPUZh4LGqFdVQpBS6acBLimmSCnsy5Yr6oBZp 0Uqv2Olygj2jg9y8B/+XeRxfWyzVXwlP/ZZx+UlLKF1eTBHssq462r29cbvBh/qpGUBL JRZQ== MIME-Version: 1.0 Received: by 10.52.174.37 with SMTP id bp5mr779828vdc.114.1342523648847; Tue, 17 Jul 2012 04:14:08 -0700 (PDT) Received: by 10.220.196.86 with HTTP; Tue, 17 Jul 2012 04:14:08 -0700 (PDT) In-Reply-To: <20120717120658.9e697878b28fb8762ff785b8@iol.ie> References: <5004C8DF.5030208@casaerwin.org> <991381645030483ABDAF4FF028EB6F89@SAI> <20120717120658.9e697878b28fb8762ff785b8@iol.ie> Date: Tue, 17 Jul 2012 13:14:08 +0200 Message-ID: Subject: Re: Macro or its equivalent to replace double spaces with single space. From: Johnny Rosenberg To: ooo-users@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 2012/7/17 Rory O'Farrell : > 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 u= sed >> > 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 =E2=80=9DUseful Macro Infor= mation >> For OpenOffice.org By Andrew Pitonyak=E2=80=9D, which is a PDF that you = can >> download somewhere: >> >> REM ***** BASIC ***** >> >> Sub RemoveRedundantSpaces >> Dim oReplace as object >> oReplace =3D ThisComponent.createReplaceDescriptor() >> >> With oReplace >> .SearchString =3D " " >> .ReplaceString =3D " " >> End With >> >> While ThisComponent.ReplaceAll(oReplace)>0 >> Wend >> End Sub >> >> >> This macro also takes care of tripple spaces and=E2=80=A6 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=E2=80=A6 >> >> Much better than using the crappy macro recorder anyway. And shorter=E2= =80=A6 >> >> If you write the documents yourself, there is a simple way to prevent >> double spaces in the first place, something like: >> Tools =E2=86=92 Options for auto correction=E2=80=A6 =E2=86=92 Click the= Options tab =E2=86=92 =E2=98=92 >> 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 >> =E3=82=B8=E3=83=A7=E3=83=8B=E3=83=BC=E3=83=BB=E3=83=AD=E3=83=BC=E3=82=BC= =E3=83=B3=E3=83=90=E3=83=BC=E3=82=B0 >> > > Or why not use the Language Tool extension, which will flag double spaces= as you type with a blue wiggly underline? One reason why not, would probably be if you want as few extensions as possible. If you don't need the other features of the extension, that is=E2=80=A6 Kind regards Johnny Rosenberg =E3=82=B8=E3=83=A7=E3=83=8B=E3=83=BC=E3=83=BB=E3=83=AD=E3=83=BC=E3=82=BC=E3= =83=B3=E3=83=90=E3=83=BC=E3=82=B0 > > -- > Rory O'Farrell > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ooo-users-unsubscribe@incubator.apache.org > For additional commands, e-mail: ooo-users-help@incubator.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: ooo-users-unsubscribe@incubator.apache.org For additional commands, e-mail: ooo-users-help@incubator.apache.org