![]() |
#1
|
|||
|
|||
![]()
Starters.xlsm
Starters.docx The strange problem is there are 5 table cells, but the listlevel stops at 4 and restarts from 1. Please take a look at the codes (quite long) Just focus on "ReadingPart5Table" (Search it and go to it) The codes before ReadingPart5Table are okay And for details, please see the attached files (see the comments on the codes) Please take a look at it if you are interested. Many thanks in advance. |
#2
|
||||
|
||||
![]()
Hi tinfanide,
Your document is empty, so I have no idea what the details about the issue are.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Yes, the document docx is empty. It's normal. I just use it for the xlsm file.
You can open a new document from Excel (xlsm) you like. So please take a look at the commented codes in xlsm (Module Starters) Code:
''' List Problem ''' Without this bit, the list starts from 1 To 5 ''' With this bit, the list stops at 4 and restarts from 1 .Cell(arr(a), 2).Select oWord.Keyboard (1033) With oWord.ActiveWindow.Selection .Range.Font.Underline = wdUnderlineDotted .TypeText Text:=FindAndReturn("Reading", 5, 1, "Ques " & a, "Prefix") & " " i = 0 Do .TypeText Text:=ChrW(160) i = i + 1 Loop Until i = 38 End With ''' ''' |
#4
|
||||
|
||||
![]()
Hi tinfanide,
OK, so I've looked at the code - and run it - but I'm still none the wiser as to what the problem is, since there's no obvious problem in the output document. Your code indenting is all of the place, so reading it is difficult, and you haven't exactly given a lot of details ... I can't even be sure how many lines of code the 'this bit' refers to.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
http://youtu.be/lZL_GkOpFWM
Please watch the vid. I've pointed to the problem that confuses me. The list problem in Word. Why does it start a new list after the bullet point number 4? |
#6
|
||||
|
||||
![]()
Hi tinfanide,
See attached. I've fixed the code - plus I declared a couple of undecalred variable and re-formatted the code for legibility. You would do well to manage your own code this way, as it makes the structure much easier to follow. The fix involved telling Word specifically whether to restart or continue the numbering. I also replaced a few unnecessary loops with Repeat statements. Your code also contains numerous blocks of repeated procedures. These could be turned into one or two separate subs, which your main procedure would then call as needed. Your Word automation could also be made to un much faster by turning screen updating off for the duration of the document's update. Even more efficient would be to have all the required tables etc. in a template and, if the data changes, simply re-populate the relevant ranges with the required data.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
bkersh | PowerPoint | 1 | 07-06-2011 09:03 AM |
Strange Word Document Problem. | ookami | Word | 5 | 05-10-2011 02:26 AM |
![]() |
Cec Britton | Outlook | 1 | 09-12-2010 10:14 AM |
![]() |
wornways | Forum Support | 2 | 08-11-2010 06:34 PM |
![]() |
Revol | Word | 3 | 10-21-2009 10:32 AM |