Having a dilemma here trying to add some text to an existing Word document.

I can use a bookmark and get my text into the document with a
Dim wordRange As Object
wordRange.InsertAfter

The problem with the above is that it "inserts" as opposed to "overwrite"
and
shifts all my other text and lines.

I've tried setting .Overtype to True and still no luck.

So my next adventure was to create a textbox via the controls toolbox
positioned
where I needed it and populate it from Excel but I can't determine how to
access
the textbox from Excel.

Anyone have any ideas on how I can do this or maybe another workaround?

Thanx,
John

Re: Automating Word via Excel by Jonathan

Jonathan
Wed Jun 30 16:06:58 CDT 2004

Don't use the Controls toolbar, use the Insert menu. That gives you an
entirely different kind of textbox.

If you want to add the textbox from code, use the
ActiveDocument.Shapes.AddTextbox method.

Once you have the textbox, you can insert text into its TextFrame.TextRange
object.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


"John Wilson" <jwilson@optonline.net> wrote in message
news:%233rlP$tXEHA.2140@TK2MSFTNGP11.phx.gbl...
> Having a dilemma here trying to add some text to an existing Word
document.
>
> I can use a bookmark and get my text into the document with a
> Dim wordRange As Object
> wordRange.InsertAfter
>
> The problem with the above is that it "inserts" as opposed to "overwrite"
> and
> shifts all my other text and lines.
>
> I've tried setting .Overtype to True and still no luck.
>
> So my next adventure was to create a textbox via the controls toolbox
> positioned
> where I needed it and populate it from Excel but I can't determine how to
> access
> the textbox from Excel.
>
> Anyone have any ideas on how I can do this or maybe another workaround?
>
> Thanx,
> John
>
>


Re: Automating Word via Excel by John

John
Thu Jul 01 12:14:14 CDT 2004

Jonathan,

>use the Insert menu.
Tried that, but I need a few of them.
How would I differentiate one from the other?
I don't see how they're named.

> If you want to add the textbox from code
I already have a document. It's a Permit Application from the
NYC Dept. of Transportation. I'd rather try to work with it
than recreate it. (It's in .doc format)

>you can insert text into its TextFrame.TextRange
Again, how to differentiate. How do I find the "object" name?

Thanks,
John



"Jonathan West" <jwest@mvps.org> wrote in message
news:%23$rxQeuXEHA.384@TK2MSFTNGP10.phx.gbl...
> Don't use the Controls toolbar, use the Insert menu. That gives you an
> entirely different kind of textbox.
>
> If you want to add the textbox from code, use the
> ActiveDocument.Shapes.AddTextbox method.
>
> Once you have the textbox, you can insert text into its
TextFrame.TextRange
> object.
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
> "John Wilson" <jwilson@optonline.net> wrote in message
> news:%233rlP$tXEHA.2140@TK2MSFTNGP11.phx.gbl...
> > Having a dilemma here trying to add some text to an existing Word
> document.
> >
> > I can use a bookmark and get my text into the document with a
> > Dim wordRange As Object
> > wordRange.InsertAfter
> >
> > The problem with the above is that it "inserts" as opposed to
"overwrite"
> > and
> > shifts all my other text and lines.
> >
> > I've tried setting .Overtype to True and still no luck.
> >
> > So my next adventure was to create a textbox via the controls toolbox
> > positioned
> > where I needed it and populate it from Excel but I can't determine how
to
> > access
> > the textbox from Excel.
> >
> > Anyone have any ideas on how I can do this or maybe another workaround?
> >
> > Thanx,
> > John
> >
> >
>