K
Krye
Problem:
I am trying to search a Word Document to extract all instances of
paragraph numbers.
For example:
1.2. Blah Blah
1.10.3.5.3.2. More Blah
Word's search feature allows you to find specific sequences such as
^p^#.^#^#. <-- Where ^p is a paragraph mark and ^# is a number. So this
search would find all paragraph numbers with 1 digit, a period, 2
digits, and a period.
My possible solution: So I want to find all paragraph numbers that are
up to six deep (I.E. 1.2.3.4.5.6.) via a VB Script. I figure the best
way is to make an array of all possible combinations and plug each
combo into the search until I've met all possible combinations. Problem
is, I haven't a clue how to pull it off the array.
There has to be an easy way to do this that i'm just missing:
A 2 number example (I.E. 1.2. or 1.18.) in psudeo code:
Legend:
# 1 digit
## 2 digits
START CODE
Look for #.
Look for ##.
Look for #.#.
Look for #.##.
Look for ##.#.
Look for ##.##.
END CODE
Now obviously you can just put that into a few loops simply enough. But
I can't get it right when I upscale it to 6 numbers.
Perhaps there's a better way of pulling it off?
Any help appreciated. Thanx!
I am trying to search a Word Document to extract all instances of
paragraph numbers.
For example:
1.2. Blah Blah
1.10.3.5.3.2. More Blah
Word's search feature allows you to find specific sequences such as
^p^#.^#^#. <-- Where ^p is a paragraph mark and ^# is a number. So this
search would find all paragraph numbers with 1 digit, a period, 2
digits, and a period.
My possible solution: So I want to find all paragraph numbers that are
up to six deep (I.E. 1.2.3.4.5.6.) via a VB Script. I figure the best
way is to make an array of all possible combinations and plug each
combo into the search until I've met all possible combinations. Problem
is, I haven't a clue how to pull it off the array.
There has to be an easy way to do this that i'm just missing:
A 2 number example (I.E. 1.2. or 1.18.) in psudeo code:
Legend:
# 1 digit
## 2 digits
START CODE
Look for #.
Look for ##.
Look for #.#.
Look for #.##.
Look for ##.#.
Look for ##.##.
END CODE
Now obviously you can just put that into a few loops simply enough. But
I can't get it right when I upscale it to 6 numbers.
Perhaps there's a better way of pulling it off?
Any help appreciated. Thanx!