atw: Re: No need for spelling ...how about a macro to scramble text?

 Steve:    = You really +must+ have a look at Perl. Will get back= shortly..
    = On Mon, 15 Sep 2003 17:13:30 +1000, Steve Hudson= wrote: >Yes - but
far= too far. What we need is something like this= (starts = >stopwatch) =
>>20 mins= l8r... = >= >>The macro= takes text and scrambles it so that
hopefully humans= can >still read it= but machines cannot. = >= >>Public
Sub=Scrambler() '(c) Word Heretic Dim DocWord As Range= Dim >Editor As=
RangeDim Char As String Dim Werd As String Dim l As= Long = >>Randomize=
Timer = >>For Each= DocWord In ActiveDocument.Words Werd =3D DocWord.Text l=
=3D >Len(Werd)= Char =3D Right$(Werd, 1) While (Char <=A0"a" Or Char=
>=A0"z")>And (Char= <=A0"A" Or Char >=A0"Z") And l >=A03 l =3D= l - 1 Werd
=3D >Left$(Werd,= l) Char =3D Right$(Werd, 1) Wend If l >=A03 Then=
'scramble>'remove first= char l =3D l - 1 Werd =3D Right$(Werd, l) 'remove
last >char l =3D l -= 1 Werd =3D Left$(Werd, l) 'set change range Set
Editor==3D = >DocWord.Duplicate With Editor .MoveStart wdCharacter, 1=
.Collapse = >wdCollapseStart .MoveEnd wdCharacter, l .Delete= .InsertAfter =
>Scramble(Werd) End With End If Next Set Editor =3D Nothing Set= DocWord
>=3DNothing End= Sub = >>Public= Function Scramble(SomeText As String) As
String '(c)= Word >Heretic Dim k= As Long Dim l As Long Dim r As Long = >>l
=3D= Len(SomeText) For k =3D l To 2 Step -1 r =3D Int(Rnd(1) * CDbl(l)= +
>1)Scramble =3D= Scramble &=A0Mid$(SomeText, r, 1) SomeText =3D =
>Left$(SomeText, r - 1) &=A0Right$(SomeText, l - r) l =3D l -= 1 Next =
>>Scramble =3D= Scramble &=A0SomeText SomeText =3D vbNullString End=
Function= >= >= >= >>Sample= output: = >>The qcuik= bowrn fox jupms oevr the
lzay dog. =A0The qucik borwn= fox >jmups oevr= the lzay dog. =A0The qicuk
bowrn fox jpmus over the= lzay >dog. =A0The= qcuik brown fox jupms over the
lzay dog. =A0The qciuk= brwon >fox jumps= oevr the lazy dog. The qcuik borwn
fox jupms over the= lzay >dog. =A0The= qiuck borwn fox jpmus over the lazy
dog. =A0The qicuk= borwn >fox jpmus= over the lazy dog. =A0The qciuk bowrn
fox jupms over= the >lazy dog.= =A0The qciuk bowrn fox jupms oevr the lazy
dog. The= quick >bowrn fox= jpmus over the lzay dog. =A0The qciuk bwron fox
jumps= over >the lazy dog.= =A0The qicuk borwn fox jupms over the lazy dog.
=A0The >qiuck brown= fox jupms oevr the lzay dog. =A0The qucik bowrn fox=
jmpus >oevr the lzay= dog. The qcuik bowrn fox jumps over the lzay dog.=
=A0The >qucik borwn= fox jpmus oevr the lazy dog. =A0The qiuck bworn fox=
jmups >oevr the lzay= dog. =A0The qciuk bowrn fox jpums over the lazy dog.
>The qiuck= brwon fox jpmus over the lazy dog. The qucik borwn= fox >jupms
over= the lazy dog. =A0The qciuk bworn fox jumps oevr the= lzay >dog.
=A0The=qcuik brwon fox jupms over the lzay dog. =A0The qciuk= bworn >fox
jpmus= over the lazy dog. =A0The qciuk borwn fox jumps over= the >lzay= dog.
= >= >>Steve= Hudson = >>Word Heretic,= Sydney, Australia Tricky stuff with
Word or words= for >you. Email: =A0= =A0 =A0steve@xxxxxxxxxxxxxxx Products:
>http:= //www.geocities.com/word_heretic/products.html[0] Spellbooks:= 728
>pages of dump= left and dropping... = >=
>************************************************** To post a= message >to=
austechwriter, send the message to= austechwriter@xxxxxxxxxxxxxx = >>To
subscribe= to austechwriter, send a message to austechwriter- =
>request@xxxxxxxxxxxxx with "subscribe" in the= Subject field. = >>To=
unsubscribe, send a message to austechwriter- = >request@xxxxxxxxxxxxx with
"unsubscribe" in the= Subject field. = >>To search the= austechwriter
archives, go to = >www.freelist.org/archives/austechwriter = >>To contact=
the list administrator, send a message to= austechwriter- =
>admins@xxxxxxxxxxxxx = >**************************************************  
=   = -Peter G. Martin,=A0 Technical writer, Proxima= Technology 
**************************************************
To post a message to austechwriter, send the message to 
austechwriter@xxxxxxxxxxxxxx

To subscribe to austechwriter, send a message to 
austechwriter-request@xxxxxxxxxxxxx with "subscribe" in the Subject field.

To unsubscribe, send a message to austechwriter-request@xxxxxxxxxxxxx with 
"unsubscribe" in the Subject field.

To search the austechwriter archives, go to 
www.freelists.org/archives/austechwriter

To contact the list administrator, send a message to 
austechwriter-admins@xxxxxxxxxxxxx
**************************************************

Other related posts: