From: "John Richards" <jhr AT universalist.worldonline.co.uk>
To: "Peter Kirk" <Peter_Kirk AT sil.org>, "Biblical Hebrew" <b-hebrew AT franklin.oit.unc.edu>
Subject: Re: OTA BHS conversion to Word 2000
Date: Wed, 22 Nov 2000 19:39:39 -0000
From: "Peter Kirk" <Peter_Kirk AT sil.org>
To: "Biblical Hebrew" <b-hebrew AT franklin.oit.unc.edu>
Sent: Wednesday, November 22, 2000 7:14 PM
Subject: RE: OTA BHS conversion to Word 2000
> I would strongly discourage adding anything like this to your normal.dot
> template. Certainly don't do so unless you 100% trust the person who sent
> you the macro - in this case John Richards. This macro could contain a
virus
> or "Trojan horse" program, which could then infect all of your document
> files or trash your system in many other ways.
I stand corrected! - and I agree with what Peter says wholeheartedly. It was
unwise of me to offer the macro in that form. I have never had a virus yet
(to my knowledge) in more than 15 years of computing - but there is always a
first time.
May I suggest therefore that anyone interested simply creates a macro and
copies in the following lines. Note that when you create a macro the first
and last lines are created automatically. You do not want them twice, but I
wanted to show the full code. Putting it printed out like this rather
highlights that it is a very "cobbled" macro! - originally written in Word
6, and largely just ported across - as the large number of
WordBasic.
starts to lines gives away immediately. But it does work quite effectively.
Once again, I am pretty sure I have no viruses (I only access very
"responsible" parts of the Internet) - but one can never be too careful.
Thank you for reminding us.
John Richards
**************************************************
Sub MAIN()
' OTABHS
' JHR 21/11/00
' a macro to format the converted OTA BHS
' in Word 2000
' Remove irregular number of surplus right margin spaces
For x = 0 To 4
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " ^p"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Next x
WordBasic.StartOfDocument
' Remove existing garbled Book Headings
WordBasic.InsertPara
WordBasic.LineUp 1
For x = 1 To 39
WordBasic.EditFind Find:="^p1 retpahC", Direction:=0, MatchCase:=0,
WholeWord:=0, PatternMatch:=0, SoundsLike:=0, Format:=0, Wrap:=2
WordBasic.CharLeft 1
WordBasic.LineDown 1
WordBasic.StartOfLine
WordBasic.LineUp 4
WordBasic.ParaDown 4, 1
WordBasic.InsertPara
WordBasic.EndOfLine
WordBasic.LineDown 1
Next x
WordBasic.StartOfDocument
' Insert spaces between chapter
For x = 0 To 928
WordBasic.EditFind Find:="retpahC", Direction:=0, MatchCase:=0,
WholeWord:=0, PatternMatch:=0, SoundsLike:=0, Format:=0, Wrap:=2
WordBasic.StartOfLine
WordBasic.InsertPara
WordBasic.LineDown 2
Next x
WordBasic.StartOfDocument
' Make sure there is only one space between chapter
For x = 0 To 3
WordBasic.EditReplace Find:="^p^p^p", Replace:="^p^p", Direction:=0,
MatchCase:=0, WholeWord:=0, PatternMatch:=0, SoundsLike:=0, ReplaceAll:=1,
Format:=0, Wrap:=2
Next x
WordBasic.StartOfDocument
' Remove all cases of "retpahC"
WordBasic.EditReplace Find:="retpahC", Replace:="", Direction:=0,
MatchCase:=0, WholeWord:=0, PatternMatch:=0, SoundsLike:=0, ReplaceAll:=1,
Format:=0, Wrap:=2
WordBasic.StartOfDocument
' Convert to SIL font and right alignment
Selection.WholeStory
Selection.Font.Name = "SIL Ezra"
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
Selection.HomeKey Unit:=wdStory
' Insert Chapter headings
For y = 1 To 39
For x = 1 To chapter(y)
WordBasic.EditFind Find:="^p^p", Direction:=0, MatchCase:=0, WholeWord:=0,
PatternMatch:=0, SoundsLike:=0, Format:=0, Wrap:=1
WordBasic.LineDown 1
WordBasic.StartOfLine
WordBasic.Insert " "
WordBasic.StartOfLine
WordBasic.Insert Book$(y)
WordBasic.StartOfLine
WordBasic.WordRight 1, 1
WordBasic.ParaDown 1, 1
WordBasic.Font "Times New Roman"
WordBasic.EndOfLine
WordBasic.LineDown 1
Next x
Next y