P
Phil Stokes
Hi, I have a macro which finds a certain piece of text in the document and
then moves down a line and then selects all the text between that and the end
of the document and the selected text is later sent out in an email. This has
been working for some time but I have recently had some problems because the
text is not being selected as before (extendmode on?) and I am sending out
blank emails.
The code fragment that I use to select the text is as follows
Selection.HomeKey wdStory
Selection.Find.Execute "Issued at"
Selection.MoveDown wdLine, 1
Selection.EndKey wdStory, wdExtend
Selection.Copy
varMessageStart = Selection
I have thought that there may be a problem when extendmode is in operation
(accidentlally) and the text is not being highlighted. I have thought of
trying to set a range from where the cursor is after the "find.execute" and
the "Linedown" to the end of the document and avoiding having to highlight
the text but I don't know how many characters will be in the first few lines
of the document.
Is there any way to set a range from the cursor point to the end of the
document.
or what is a foolproof way of ensuring that the extend mode is off and that
the selection will always include the text I want to copy?
Thanks
Phil
then moves down a line and then selects all the text between that and the end
of the document and the selected text is later sent out in an email. This has
been working for some time but I have recently had some problems because the
text is not being selected as before (extendmode on?) and I am sending out
blank emails.
The code fragment that I use to select the text is as follows
Selection.HomeKey wdStory
Selection.Find.Execute "Issued at"
Selection.MoveDown wdLine, 1
Selection.EndKey wdStory, wdExtend
Selection.Copy
varMessageStart = Selection
I have thought that there may be a problem when extendmode is in operation
(accidentlally) and the text is not being highlighted. I have thought of
trying to set a range from where the cursor is after the "find.execute" and
the "Linedown" to the end of the document and avoiding having to highlight
the text but I don't know how many characters will be in the first few lines
of the document.
Is there any way to set a range from the cursor point to the end of the
document.
or what is a foolproof way of ensuring that the extend mode is off and that
the selection will always include the text I want to copy?
Thanks
Phil