Susan
2012-03-15 13:17:10 UTC
I am much better at VBA in Excel than Word. The code below is
probably absolutely useless but i tried.........
What I want to do is put my Bible on my Kindle in book text files that
will be easily searchable. I can put the version on the Kindle in a
PDF file, but it is so large it is basically unsearchable. To give
you an example (i am using Word 2003 in Windows XP):
1 [THIS IS THE CHAPTER NUMBER AND IS IN BOLD PRINT] In [the] beginning
God created the heavens and the earth.
2 [THIS IS THE VERSE NUMBER AND IS IN SUPERSCRIPT] Now the earth
proved to be formless and waste and there was darkness upon the
surface of [the] watery deep; and God’s active force was moving to and
fro over the surface of the waters.
3 And God proceeded to say: “Let light come to be.” Then there came to
be light. 4 After that God saw that the light was good, and God
brought about a division between the light and the darkness. 5 And God
began calling the light Day, but the darkness he called Night. And
there came to be evening and there came to be morning, a first day.
BLAH BLAH BLAH ON TO CHAPTER 2
2 [CHAPTER NUMBER IN BOLD] Thus the heavens and the earth and all
their army came to their completion. 2 [VERSE NUMBER IN SUPERSCRIPT]
And by the seventh day God came to the completion of his work that he
had made, and he proceeded to rest on the seventh day from all his
work that he had made. 3 And God proceeded to bless the seventh day
and make it sacred, because on it he has been resting from all his
work that God has created for the purpose of making.
4 This is a history of the heavens and the earth in the time of their
being created, in the day that Jehovah God made earth and heaven.
so what i want is to search each paragraph. if the number at the
beginning of the paragraph is in bold (may be 1-3 digits), then make
that number the string "NumPara". then find each additional number
(the verses). then make each additional number into a string
x.String = NumPara.String & ":" & x.String. when you get to the next
bold number, start over.
So in Chapter 1 you'd end up with
1 [THIS IS THE CHAPTER NUMBER AND IS IN BOLD PRINT] In [the] beginning
God created the heavens and the earth.
1:2 [THIS IS THE VERSE NUMBER AND IS IN SUPERSCRIPT] Now the earth
proved to be formless and waste and there was darkness upon the
surface of [the] watery deep; and God’s active force was moving to and
fro over the surface of the waters.
1:3 And God proceeded to say: “Let light come to be.” Then there came
to be light. 1:4 After that God saw that the light was good, and God
brought about a division between the light and the darkness. 1:5 And
God began calling the light Day, but the darkness he called Night.
if the first number in the next paragraph is NOT bold, but is superscript, then you'd continue with the above search & replace.
Like i said, the code is probably garbage, but i tried..........
anybody who could help I would greatly appreciate it.
'**************************************************************
Option Explicit
Sub makeverses()
Dim Paragraph As Object
Dim NumPara As Object
Dim NewNum As String
Dim NewPara As Range
Dim x As Object
Dim Doc As Document
Set Doc = ActiveDocument
Set Paragraph = ActiveDocument.Paragraphs
For Each Paragraph In Doc
Set Paragraph = NewPara
Set NumPara = String(msoPropertyTypeNumber, 1 - 3)
If NumPara.Font.Bold = True Then
Set x = String(msoPropertyTypeNumber, 1 - 3)
For Each x In NewPara
x.String = NumPara.String & ":" & x.String
Next x
End If
Next Paragraph
End Sub
probably absolutely useless but i tried.........
What I want to do is put my Bible on my Kindle in book text files that
will be easily searchable. I can put the version on the Kindle in a
PDF file, but it is so large it is basically unsearchable. To give
you an example (i am using Word 2003 in Windows XP):
1 [THIS IS THE CHAPTER NUMBER AND IS IN BOLD PRINT] In [the] beginning
God created the heavens and the earth.
2 [THIS IS THE VERSE NUMBER AND IS IN SUPERSCRIPT] Now the earth
proved to be formless and waste and there was darkness upon the
surface of [the] watery deep; and God’s active force was moving to and
fro over the surface of the waters.
3 And God proceeded to say: “Let light come to be.” Then there came to
be light. 4 After that God saw that the light was good, and God
brought about a division between the light and the darkness. 5 And God
began calling the light Day, but the darkness he called Night. And
there came to be evening and there came to be morning, a first day.
BLAH BLAH BLAH ON TO CHAPTER 2
2 [CHAPTER NUMBER IN BOLD] Thus the heavens and the earth and all
their army came to their completion. 2 [VERSE NUMBER IN SUPERSCRIPT]
And by the seventh day God came to the completion of his work that he
had made, and he proceeded to rest on the seventh day from all his
work that he had made. 3 And God proceeded to bless the seventh day
and make it sacred, because on it he has been resting from all his
work that God has created for the purpose of making.
4 This is a history of the heavens and the earth in the time of their
being created, in the day that Jehovah God made earth and heaven.
so what i want is to search each paragraph. if the number at the
beginning of the paragraph is in bold (may be 1-3 digits), then make
that number the string "NumPara". then find each additional number
(the verses). then make each additional number into a string
x.String = NumPara.String & ":" & x.String. when you get to the next
bold number, start over.
So in Chapter 1 you'd end up with
1 [THIS IS THE CHAPTER NUMBER AND IS IN BOLD PRINT] In [the] beginning
God created the heavens and the earth.
1:2 [THIS IS THE VERSE NUMBER AND IS IN SUPERSCRIPT] Now the earth
proved to be formless and waste and there was darkness upon the
surface of [the] watery deep; and God’s active force was moving to and
fro over the surface of the waters.
1:3 And God proceeded to say: “Let light come to be.” Then there came
to be light. 1:4 After that God saw that the light was good, and God
brought about a division between the light and the darkness. 1:5 And
God began calling the light Day, but the darkness he called Night.
if the first number in the next paragraph is NOT bold, but is superscript, then you'd continue with the above search & replace.
Like i said, the code is probably garbage, but i tried..........
anybody who could help I would greatly appreciate it.
'**************************************************************
Option Explicit
Sub makeverses()
Dim Paragraph As Object
Dim NumPara As Object
Dim NewNum As String
Dim NewPara As Range
Dim x As Object
Dim Doc As Document
Set Doc = ActiveDocument
Set Paragraph = ActiveDocument.Paragraphs
For Each Paragraph In Doc
Set Paragraph = NewPara
Set NumPara = String(msoPropertyTypeNumber, 1 - 3)
If NumPara.Font.Bold = True Then
Set x = String(msoPropertyTypeNumber, 1 - 3)
For Each x In NewPara
x.String = NumPara.String & ":" & x.String
Next x
End If
Next Paragraph
End Sub