Use variable with small Roman numerals?

E

Ed

In a looped Find/Replace routine, I want to use a variable that I can
increment with each loop. I want to find "i" and replace with "1", "ii"
with "2", etc. Something like:

Dim x
x=0
Do
x=x+1
Find x Format(small Roman numeral)
Replace With x (Arabic number)
Loop

Is a Format switch for something like this available?
--
Ed
Chief Chef,
Kludge Code Cafe
"Spaghetti Is Our Specialty!"
'
 
D

Doug Robbins - Word MVP

Is this also to deal with v, x, c, l, m as well as combinations of those
with i?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
E

Ed

Hi, Doug. Actually, I'm thinking this might need to be a bit deeper - like
a type of conversion function. I get documents that have to be inserted
into my reports. These docs can come from almost anywhere, and can be
formatted in any hodge-podge manner. The element I was trying to deal with
was a list of items that was indented and incremented with Roman numerals.
I was trying to think of a macro, rather than hand-massage 15 pages!

Then I realized some of them could need to be alpha rather than numeric - it
just depended on where they fell in the indentation scheme. I had figured
out how I could select a listing and replace the current indent with the
indention my report required - except I couldn't find how to capture the
number/alpha and convert it to what I needed.

The closest I came up with was formatting a Word field
(http://www.gmayor.com/formatting_word_fields.htm), but I wasn't sure how I
could access those switches to get done what wanted, if indeed it's even
really possible. If you have any suggestions, they would be most welcome.

Ed
 
D

Doug Robbins - Word MVP

Writing a macro to sort out a hodge-podge situation would be, if not
impossible, no mean feat.

I would think that what you need to be doing is using Styles and then
possibly, you can set up a routing that searches for each type of number and
applies the appropriate style to the paragraph.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
E

Ed

Writing a macro to sort out a hodge-podge situation would be, if not
impossible, no mean feat.
Yeah - that's why I've got 64 modules stuffed full of one-off variations to
deal with every possible way they screw things up!
I would think that what you need to be doing is using Styles and then
possibly, you can set up a routing that searches for each type of number
and applies the appropriate style to the paragraph.
The reports I produce have to be fairly free of almost any styles except for
Normal and TOC Heading styles. Formatting such as bold, italic, or
underline is directly applied to any words that need it. There are no
subparagraph styles with automatic indents and numbering.

Or at least, not in _my_ reports. The ones I get to incorporate - that's a
different story. And that's one issue I've scratched my head on: how do I
take a series of subparagraphs that have been auto-indented and numbered
using Bullets and Numbering, and remove the autonumber format while
retaining the assigned number? Is that possible?

Ed
 
C

Cindy M -WordMVP-

Hi Ed,
And that's one issue I've scratched my head on: how do I
take a series of subparagraphs that have been auto-indented and numbered
using Bullets and Numbering, and remove the autonumber format while
retaining the assigned number?
have you tried using Range.ListFormat.ConvertNumbersToText

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
E

Ed

have you tried using Range.ListFormat.ConvertNumbersToText
No, not yet, Cindy - but I will now!! Thank you!

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top