D
dethomas143
I'm trying to create a vbscript that among other things adds some text
to an existing Word document in a specific place within the document.
I calculate the place to enter the text by the numer of characters from
the start of the document.
After working with the word documentation, it seems that what I want to
do is set the appropriate range within the document based on the number
of characters and then to an InsertAfter.
The problem is I am unable to set either the start or end of the range.
The documentation uses syntax like this: ActiveDocument.Range (Start
:= 0, End := intNumChars)
VBscript will not use this syntax, however. Aside from the
parentheses, it does not understand the := In VBScript = is used for
assignment and I can use something like
this: ActiveDocument.Range.End = intNumChars
I get no error when I run this, but the value does not get set. If I
check the value of Range.End immediately after executing this statement
it is the total length of the document. I've verified that intNumChars
has the value I expect it to have.
I'm hoping someone can tell me how I can set the start and end values
of the range using vbscript.
Thanks In Advance,
David E. Thomas
to an existing Word document in a specific place within the document.
I calculate the place to enter the text by the numer of characters from
the start of the document.
After working with the word documentation, it seems that what I want to
do is set the appropriate range within the document based on the number
of characters and then to an InsertAfter.
The problem is I am unable to set either the start or end of the range.
The documentation uses syntax like this: ActiveDocument.Range (Start
:= 0, End := intNumChars)
VBscript will not use this syntax, however. Aside from the
parentheses, it does not understand the := In VBScript = is used for
assignment and I can use something like
this: ActiveDocument.Range.End = intNumChars
I get no error when I run this, but the value does not get set. If I
check the value of Range.End immediately after executing this statement
it is the total length of the document. I've verified that intNumChars
has the value I expect it to have.
I'm hoping someone can tell me how I can set the start and end values
of the range using vbscript.
Thanks In Advance,
David E. Thomas