Hello,
Are you trying to run same macro for two different word documents? You can only set your macro to repeat for 'N' time so you would not be able to change the repeat time during run time.
What you can do is record a macro where you copy text from one page and paste it to powerpoint. You have to set it to repeat for '10' times for one word document. and change it to repeat for '6' times for second word document.
Alternatively, you can try our advanced automation software, Automation Anywhere 3.5 that has a lot of several conditional commands that you can use to figure out when to stop the macro.
For e.g. if 6th page is the last page and it has some keyword that indicates so, then you make use of the following condition
If $Clipboard$ Includes <some text> Then
Stop Task
End If
You can download the Free trial from Automation Anywhere 3.5 from
http://www.tethyssolutions.com/automation-software.htm