R
Rebecca
Season's Greetings.
I'm using MS Window XP and MS Office XP. I need a macro
for MS Word, but when it comes to programmimg in VBA I
don't know if I'm coming or going.
I will be deeply appreciative if you could patiently try
to understand my stumbling and lengthy explanation,
because the macro I desperately need will require some
very fancy programming, and least by my standards. Any
takers?
I have a document that has Hebrew and English words and
(greatly simplified) looks structually like this (because
Hebrew fonts can not be displayed in this post, I will use
made-up words after the numbers):
WTT Genesis 1:1
1. fghi
a. fghi
2. gfjk
a. k
b. gfj
3. lmnop
a. p
b. o
c. lmn
4. eee
a. eee
5. ddaaaa
a. a
b. aa
c. aaa
d. dda
WTT Genesis 1:2
1. bbbac
a. c
b. a
2. cbaa
a. cbaa
3. ecda
a. a
b. d
c. ec
and so on, and so forth. Each line consists of one
paragraph. After each number (say the "1. fghi," above in
Genesis 1:1) there is either an
a. ...,
or an a. ... and b. ...,
or an a. ..., b. ..., and c. ...,
or an a. ..., b. ..., c. ..., and d. ...
(each of the four letters are, of course, on a separate
line).
Now I need a macro to proceed from the top of the file to
the bottom of a file in "Document A," and after each
number "determine" if there is only an "a. ..." or
an "a. ..." plus a "b. ..." or whatever the combination
(a. through d.).
Then, to complicate matters, once the macro determines the
number of letters (a. through d.) in the sentences below
the numbered paragraph, to go back up to the same number
(say "1. fghi," above) copy the entire word ("fghi" in
Document A), and then paste this same word into another
file (in "Document B" -- thus, there will be two windows
open, side by side, A on the right and B on the left).
However, if there is an "a." and a "b." after the number,
the macro should go back up to the numbered sentence above
(say "2. gfjk" in verse 1:1), copy the word after the
letter, i.e., "gfjk," copy this word on the next line in
Document B, then delete everything but the last letter in
the word (i.e., delete "gfj" and leave the "k"), then jump
down one paragraph copy the same word again, but this time
delete the last letter (i.e., the "k") in the
word "gfjk." Thus, so far the paragraphs in Document B
should look like this:
fghi
k
gfj
One more thing. I need the macro to stop temporarily
whenever there are sentences with "c"s or "d"s in them, in
order to enable me to do something manually, then push a
key and get the program to start up again.
Phew! If you are still with me, could you please give me
some hints about how I can go about creating such a
macro? I'm sure there are better ways to perform the
operation I need done (or more lucid ways of explaning
what I need done), but I could use all the help I can get.
Regards,
Rebecca
I'm using MS Window XP and MS Office XP. I need a macro
for MS Word, but when it comes to programmimg in VBA I
don't know if I'm coming or going.
I will be deeply appreciative if you could patiently try
to understand my stumbling and lengthy explanation,
because the macro I desperately need will require some
very fancy programming, and least by my standards. Any
takers?
I have a document that has Hebrew and English words and
(greatly simplified) looks structually like this (because
Hebrew fonts can not be displayed in this post, I will use
made-up words after the numbers):
WTT Genesis 1:1
1. fghi
a. fghi
2. gfjk
a. k
b. gfj
3. lmnop
a. p
b. o
c. lmn
4. eee
a. eee
5. ddaaaa
a. a
b. aa
c. aaa
d. dda
WTT Genesis 1:2
1. bbbac
a. c
b. a
2. cbaa
a. cbaa
3. ecda
a. a
b. d
c. ec
and so on, and so forth. Each line consists of one
paragraph. After each number (say the "1. fghi," above in
Genesis 1:1) there is either an
a. ...,
or an a. ... and b. ...,
or an a. ..., b. ..., and c. ...,
or an a. ..., b. ..., c. ..., and d. ...
(each of the four letters are, of course, on a separate
line).
Now I need a macro to proceed from the top of the file to
the bottom of a file in "Document A," and after each
number "determine" if there is only an "a. ..." or
an "a. ..." plus a "b. ..." or whatever the combination
(a. through d.).
Then, to complicate matters, once the macro determines the
number of letters (a. through d.) in the sentences below
the numbered paragraph, to go back up to the same number
(say "1. fghi," above) copy the entire word ("fghi" in
Document A), and then paste this same word into another
file (in "Document B" -- thus, there will be two windows
open, side by side, A on the right and B on the left).
However, if there is an "a." and a "b." after the number,
the macro should go back up to the numbered sentence above
(say "2. gfjk" in verse 1:1), copy the word after the
letter, i.e., "gfjk," copy this word on the next line in
Document B, then delete everything but the last letter in
the word (i.e., delete "gfj" and leave the "k"), then jump
down one paragraph copy the same word again, but this time
delete the last letter (i.e., the "k") in the
word "gfjk." Thus, so far the paragraphs in Document B
should look like this:
fghi
k
gfj
One more thing. I need the macro to stop temporarily
whenever there are sentences with "c"s or "d"s in them, in
order to enable me to do something manually, then push a
key and get the program to start up again.
Phew! If you are still with me, could you please give me
some hints about how I can go about creating such a
macro? I'm sure there are better ways to perform the
operation I need done (or more lucid ways of explaning
what I need done), but I could use all the help I can get.
Regards,
Rebecca