PDA

View Full Version : Solved: Bible study



Pasquale
10-07-2005, 06:08 AM
Hallo, I need help in my bible study.
I must format a text in this form:
1) Where there is a word write in bold characters. I must write before <g> space Txt space and after </g>

Example:[Mat 1,6]
<g> Daui.d to.n </g>
<g> Dabi.d to.n </g> j
<g> Daui.d de. </g> Biz WH

<g> Dabi.d de. </g>

<g> de. evge,nnhsen </g> p<sup>1</sup> ? B G f1 f13 579 700 pc it<sup>g1,k</sup> vg<sup>mss</sup> sir<sup>s,c,p</sup> cop arm

<g> de. o` basileu=j evge,nnhsen </g> C L W D P 33 157 892 1071 Biz vg sir<sup>h</sup> geo j; ND,Dio

I hope that you read Greek.

I had this previous Macro that works only with All UCase. How can be able modify this macro???

Selection.HomeKey wdStory

With Selection.Find
.ClearFormatting
.Font.Bold = True
.Text = "<*>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With

While Selection.Find.Execute
If Selection.Text = UCase(Selection.Text) Then
Do
If Selection.End = ActiveDocument.Range.End Then Exit Do
If Not Selection.Next(wdWord, 1).Font.Bold Then Exit Do
If Selection.Next(wdWord, 1).Text <> UCase(Selection.Next(wdWord, 1).Text) Then Exit Do
Selection.MoveEnd wdWord, 1
Loop
Selection.InsertBefore "<p><b>"
Selection.InsertAfter "</b>"
End If
Selection.Collapse wdCollapseEnd
Wend


Pasquale:bow: :yes

fumei
10-07-2005, 07:41 AM
Could you give your requirements again?

You state:

1) Where there is a word write in bold characters. I must write before <g> space Txt space and after </g>

but all your examples already have <g> in them....so I do not understand. If they already have <g? there, why do you need to write it in again.

Also, in the example code you are added <p> and <b> NOT <g>.

So I have no idea what exactly you want.

Pasquale
10-07-2005, 07:58 AM
Hi Fumei, I write a final text.

This is correct text to put before bold word or period <g> and after </g>:
Example:
[Mat 1,10]
'Amw,j( 'Amw,j] ? B C (D in Luca) D G Q P* f1 33 157 205 1071 1079 1291 1546 l68,(184),253,672,673,813,1223,1627 itc,(d),ff1,g1,k,q vgmss copsa,bo,fay arm et geo Atanasio Epifanio; CEI,TILC,Nv
'Amw,n( 'Amw,n] E K L W P2 S f13 28 180 565 579 597 (700 892 1195 l211 itaur,f 'Ammw,n) 1006 1009 1010 1216 1230 1241 1242 1243 1342 1365 1424 1505 1646 2148 Biz Lez ita vg(mss) sirc,s,p,h,pal (copmae) slav j (Ps-Eustatio) Agostino; NR,ND,Riv,Dio,NM

Also the macro is bad for another work:
this is correct macro:
Sub Manoscritti1()
'
' Manoscritti1 Macro
' Macro creata il 10/09/2005 da Pasquale
'
Selection.HomeKey wdStory

With Selection.Find
.ClearFormatting
.Font.Bold = True
.Text = "<*>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With

While Selection.Find.Execute
If Selection.Text = UCase(Selection.Text) Then
Do
If Selection.End = ActiveDocument.Range.End Then Exit Do
If Not Selection.Next(wdWord, 1).Font.Bold Then Exit Do
If Selection.Next(wdWord, 1).Text <> UCase(Selection.Next(wdWord, 1).Text) Then Exit Do
Selection.MoveEnd wdWord, 1
Loop
Selection.InsertBefore "<p><g>"
Selection.InsertAfter " </g>"
End If
Selection.Collapse wdCollapseEnd
Wend
End Sub

Thanks Pasquale

Pasquale
10-07-2005, 08:35 AM
Another error:
Correct is:

Selection.InsertBefore "<g>"
Selection.InsertAfter " </g>"

TonyJollans
10-07-2005, 09:23 AM
Hi Pasquale,

In this code (you posted) the lines in red check for uppercase so just remove them (the complete lines - it looks like the VBA formatting changes the color of some of it):

While Selection.Find.Execute
If Selection.Text = UCase(Selection.Text) Then
Do
If Selection.End = ActiveDocument.Range.End Then Exit Do
If Not Selection.Next(wdWord, 1).Font.Bold Then Exit Do
If Selection.Next(wdWord, 1).Text <> UCase(Selection.Next(wdWord, 1).Text) Then Exit Do
Selection.MoveEnd wdWord, 1
Loop
Selection.InsertBefore "<g>"
Selection.InsertAfter "</g>"
End If
Selection.Collapse wdCollapseEnd
Wend

I haven't tried using it but you may have to change the .Text on the find from "<*>" to just "". as well.

fumei
10-07-2005, 10:01 AM
Sorry, but your example text does not help at all. I will let Tony take this.

Pasquale
10-07-2005, 10:50 AM
Hi Tony,
the macro works, but I have a problem,
the greek words are written with apostrophised and accented characters, therefore the VBA macro recognises two words rather than one word.
So it appears with the insert <g>opti'</g><g>ons</g> dividing one word in two.
The macro should insert <g> at the beginning of a sequence of bold words and </g> at the end of the same sequence of bold words.
Thanks
Pasquale

TonyJollans
10-07-2005, 12:13 PM
Hi Pasquale,

Did you change the Text?

Gerry,

I have an advantage :) I have helped Pasquale before and got used to what he is doing.

Pasquale
10-07-2005, 01:36 PM
Hi Tony,
I had finished two works, this is another work with greek variants of Greek New Testament.
I ever utilize your macro for merge text, and format every Text to utilize your macro.

I think that it is the line to change (in your previuous macro it worked in a correct way with latin words).

If Selection.Next(wdWord, 1).Text <> UCase(Selection.Next(wdWord, 1).Text) Then Exit Do
Selection.MoveEnd wdWord, 1

Pasquale

TonyJollans
10-07-2005, 02:24 PM
No, sorry, I think you are misunderstanding me.

In the Find, change the text to look for ..

With Selection.Find
.ClearFormatting
.Font.Bold = True
.Text = "" ' <--- Change this line
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With

That should stop it breaking at word boundaries.

Pasquale
10-07-2005, 02:37 PM
Hi Tony, you are a magician...with VBA,
it works very well, I test it.

New text is this?

.Text = "" '

I do understand?

Thanks Pasquale