P
Phil Stokes
Hi All,
I have a macro that seeks out a particular string of text in a document and
then moves down one line and selects the remaining text nin the document and
writes it to a variable and then uses it subsequently in the message section
of an email.
Recently this method has been failing because the text is not being
selected. I don't know if the PC was in EST mode a the time but I need the
macro to work no matter what. The code I use is as follows
Selection.HomeKey wdStory
Selection.Find.Execute "Issued at"
Selection.MoveDown wdLine, 1
Selection.EndKey wdStory, wdExtend
Selection.Copy
End If
varMessageStart = Selection
I was considering replacing this code with code that creates a range from
the cursor to the end of the document and then writes that to the variable
but I don't know the character count down to the point that I wish to copy
from so.. my question is, is there code available that could create a range
as described above or would I be better trying something different. Is there
a way to ensure that the code above actually highlights the text and copies
it.
I have a macro that seeks out a particular string of text in a document and
then moves down one line and selects the remaining text nin the document and
writes it to a variable and then uses it subsequently in the message section
of an email.
Recently this method has been failing because the text is not being
selected. I don't know if the PC was in EST mode a the time but I need the
macro to work no matter what. The code I use is as follows
Selection.HomeKey wdStory
Selection.Find.Execute "Issued at"
Selection.MoveDown wdLine, 1
Selection.EndKey wdStory, wdExtend
Selection.Copy
End If
varMessageStart = Selection
I was considering replacing this code with code that creates a range from
the cursor to the end of the document and then writes that to the variable
but I don't know the character count down to the point that I wish to copy
from so.. my question is, is there code available that could create a range
as described above or would I be better trying something different. Is there
a way to ensure that the code above actually highlights the text and copies
it.