Please: How to insert TextBox into MS Word or ...

K

Kristijan Marin

Hi,

Anybody knows what to call to insert TextBox into MS Word document ? As if i
would go in Menu->Insert->TextBox ...
which inserts box on absolute position in the document ?

I'm on na project where in one application user draws rectangles on the
blank A4 paper/page which represents sections in MS WOrd document where some
data will be put in......

Now I have a problem cause from 1st application i get a rectangle
coordinates of a section, but don't know how to absolute position text
inside Word ....

Anyone has any clue ? Or any other way how to absolute position text,image
itd..... ?

Thank you guys.

/Kris
 
A

Andrey Dzizenko

I see coordinates are a big pain in the ass in Word =)

There's Document.Shapes.AddTextBox, I think it can get absolute
coordinates.

I know that there's a magic double-click in opened MS Word application
that can move the cursor to this double-click position. Even in there's
just one paragraph in the document.
I'd realize it like that. Enumerate all paragraphs in the document. For
each paragraph get its vertical coordinate
(Paragraph.Range.get_Information(dontrememberconstantname)) and compare
with needed coordinate. If document end is reached you should add as many
paragraphs as needed.
Then enumerate chars in the founded paragraph. Get its horizontal
coordinate and blablabla.

I don't know if there's a method that's easier and (the most important)
quicker... Everything will be slower than you can imagine =)

Hope it helps...

Andrey Dzizenko.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top