balloon_tom
Thread Starter
- Joined
- Jan 4, 2006
- Messages
- 107
This is my first attempt at using macros with Word (2003). I can macro my way through Excel pretty well, but Word is a different story. It's sloppy, but plesae bear with me. (Any suggested improvements are welcome).
This Word project is opened by Excel and variables are passed to it through the PrintTable macro. I have created a Sub Test() macro which populates all the variables and runs the project without the need for the Excel.
The project begins by searching for 4 sentences/paragraphs, and then deleting them if they exist. Sub Delet() sets the first phrase to search for (Strt) and the last (Stp). Sub DelText() searches the document and accomplishes the deletion.
3 of the 4 work perfectly, but the deletion starting with the word "WAIVER:" does not. It worked yesterday, but not today.
The sub finds the Strt phrase and then moves up seaching for the first non blank line. So far, so good. It then does a MoveDown with Extend seaching for the Stp phrase. With the 3 working deletions, this MoveDown works, but with WAIVER, the move is not done.
Can you see what I'm missing?
Thanks,
Tom
This Word project is opened by Excel and variables are passed to it through the PrintTable macro. I have created a Sub Test() macro which populates all the variables and runs the project without the need for the Excel.
The project begins by searching for 4 sentences/paragraphs, and then deleting them if they exist. Sub Delet() sets the first phrase to search for (Strt) and the last (Stp). Sub DelText() searches the document and accomplishes the deletion.
3 of the 4 work perfectly, but the deletion starting with the word "WAIVER:" does not. It worked yesterday, but not today.
The sub finds the Strt phrase and then moves up seaching for the first non blank line. So far, so good. It then does a MoveDown with Extend seaching for the Stp phrase. With the 3 working deletions, this MoveDown works, but with WAIVER, the move is not done.
Can you see what I'm missing?
Thanks,
Tom
Attachments
-
120.5 KB Views: 107