Information générale
Catégorie:
Codage, syntaxe et commandes
>How would I position the cursor one line below the last record of the first MS Word table? I've tried using the value of nCounter (from above) once the first MS Word table has been created, but no matter what I do, the second MS Word table always ends up being created in Cell 1,1 of the first MS Word table.
First, eliminate the oRange.Select() from your code. It buys you nothing and just takes unnecessary time.
To solve your problem, use the Collapse method:
oRange.Collapse(0)
This reduces the Range to its endpoint. Then you can add a return and collapse it again. In general, when you're manipulating a range, the Collapse method is very useful.
All that said, I don't remember for sure whether collapsing a range that contains a table gets you out of the table. If necessary, add a return before you add the first table, then collapse the range to its start point (by passing 1 rather than 0) and add the first table. That ensures that you have something to grab after the table.
Tamar
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement