Importing from Word and Numbered lists

Everything related to our flagship word processor.
Post Reply
Kadah
Posts: 16
Joined: 2016-02-19 13:26:05

Importing from Word and Numbered lists

Post by Kadah »

Hi! Twice a year I prepare a kind of raport for my workplace. Over sixty people send me thier documents, and from theirs I make a collective one and add some things. Nisus is great, but there is one thing that drives me crazy. I cannot figure out how to select all numbered lists and change them to one kind of list. When I import form Word, I usually have more than forty numbered lists' and bullet points' styles. I only want one of each! Could anyone maybe help me?
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Importing from Word and Numbered lists

Post by phspaelti »

Hello Kadah,
Here is a macro that might help. Please be careful. Make sure to keep a copy of your file before you try to run this.
If you have any trouble, let me know.

[Macro replaced with improved version below]
Last edited by phspaelti on 2018-06-27 15:55:44, edited 1 time in total.
philip
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: Importing from Word and Numbered lists

Post by Þorvarður »

Hello Philip,
I run the macro early this morning on a document with several different list styles, but nothing happened. Now, several hours later, I tried again and now I get the error message that there is an error on line 18: the variable "$type" has not been defined.

I first thought the original poster wanted to use only one list style, so I was thinking whether it isn't possible to write a macro to select all list styles in the document, and then let the user choose the preferred list style or a new list style from the List Style palette? That would give the whole document a unified list style and leave text passages, where there is no list style, untouched.

But now I realize he has "more than forty numbered lists' and bullet points' styles" and wants only "one of each" … I don't understand what "one of each" is supposed to mean.
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Importing from Word and Numbered lists

Post by phspaelti »

Hello Þorvarður
I'm pretty sure that this is what he is talking about:
Word_Import_list_styles.png
Word_Import_list_styles.png (19.96 KiB) Viewed 9507 times
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Importing from Word and Numbered lists

Post by phspaelti »

Þorvarður wrote: 2018-06-27 01:55:51 I run the macro early this morning on a document with several different list styles, but nothing happened. Now, several hours later, I tried again and now I get the error message that there is an error on line 18: the variable "$type" has not been defined.
I see. I'm guessing that you have list styles that have a name that does not contain the word "List". I realize now that I should probably handle cases like that better. Thanks for the feedback.

But it's also true that if you don't have groups of styles of the form "Numbered List 1", "Numbered List 2", "Numbered List 3", … you will not see any effect from my macro, even if it completes successfully.
philip
Kadah
Posts: 16
Joined: 2016-02-19 13:26:05

Re: Importing from Word and Numbered lists

Post by Kadah »

I tried the macro and it does not work for me, unfortuntely. But thanks for trying!
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Importing from Word and Numbered lists

Post by phspaelti »

Wait a minute. What do you mean "it does not work for me"?
  1. It doesn't (seem to) do anything at all
  2. it stops and gives me an error
  3. it does something, but not the thing that I want
Anyhow here first a new version of the earlier macro, which fixes the problem mentioned by Þorvarður.
Reduce Extraneous List Styles.nwm.zip
(3.22 KiB) Downloaded 472 times

And here a macro that works differently. This one will only combine one kind at a time, so you will have to run it once for Bullet lists, and once for Number lists, etc. Run the macro and select the ones you want to combine, and all will be combined to the first. This should work no matter what your list styles are called.
Combine List Styles.nwm.zip
(2.62 KiB) Downloaded 452 times
philip
Kadah
Posts: 16
Joined: 2016-02-19 13:26:05

Re: Importing from Word and Numbered lists

Post by Kadah »

It didn't seem to do anything. But I found a workaround. I start the macro "select by style", select all numbered list styles and choose one style for all of them. Later I delete all the unnecessary styles. It' s quick and it works for me.
Post Reply