Originally Posted by
Frosty
And by the way, using the Selection object in code, and then manipulating the document (i.e., the Selection object) while debugging your code can lead to lots of unexpected behavior.
Off the top of my head--
1. Your selection could look like it's after a table, but it's actually just before the end of the table marker... trying to manipulate that range is going to cause problems.
2. Your selection could be right next to another table, which could cause an issue when you then create a new table at that spot (i.e., while your temptable variable may seem like it's handling one table, you might have caused word to merge the table with something).
3. Your selection could be somewhere "bad"
4. You could be encountering a real bug. This last scenario is the least likely since, as you say, you are a neophyte programmer. The most likely scenario is that you are causing your own problem.