Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

Use variable with small Roman numerals?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 31 Jul 2006 16:44 GMT
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?
Signature

Ed
Chief Chef,
Kludge Code Cafe
"Spaghetti Is Our Specialty!"
'

Doug Robbins - Word MVP - 01 Aug 2006 04:46 GMT
Is this also to deal with v, x, c, l, m as well as combinations of those
with i?

Signature

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

> 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"
[quoted text clipped - 9 lines]
>
> Is a Format switch for something like this available?
Ed - 01 Aug 2006 14:59 GMT
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

> Is this also to deal with v, x, c, l, m as well as combinations of those
> with i?
[quoted text clipped - 12 lines]
>>
>> Is a Format switch for something like this available?
Doug Robbins - Word MVP - 01 Aug 2006 22:03 GMT
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.

Signature

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

> 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
[quoted text clipped - 33 lines]
>>>
>>> Is a Format switch for something like this available?
Ed - 02 Aug 2006 00:51 GMT
> 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

> Writing a macro to sort out a hodge-podge situation would be, if not
> impossible, no mean feat.
[quoted text clipped - 41 lines]
>>>>
>>>> Is a Format switch for something like this available?
Cindy M  -WordMVP- - 02 Aug 2006 17:25 GMT
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 :-)
Ed - 02 Aug 2006 18:54 GMT
> have you tried using Range.ListFormat.ConvertNumbersToText
No, not yet, Cindy - but I will now!!  Thank you!

Ed

> Hi Ed,
>
[quoted text clipped - 12 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.