views:

1148

answers:

2

I'm working on a document "wizard" for the company that I work for. It's a .dot file with a header consisting of some text and some form fields, and a lot of VBA code. The body of the document is pulled in as an OLE object from a separate .doc file.

Currently, this is being done as a Shape, rather than an InlineShape. I did this because I can absolutely position the Shape, whereas the InlineShape always appears at the beginning of the document.

The problem with this is that a Shape doesn't move when the size of the header changes. If someone needs to add or remove a line from the header due to a special case, they also need to move the object that defines the body. This is a pain, and I'd like to avoid it if possible.

Long story short, how do I position an InlineShape using VBA in Word?

The version I'm using is Word 97.

+2  A: 

InlineShape is treated as a letter. Hence, the same technique.

ThisDocument.Range(15).InlineShapes.AddPicture "1.gif"
GSerg
A: 

My final code ended up using ThisDocument.Paragraphs to get the range I needed. But GSerg pointed me in the right direction of using a Range to get my object where it needed to be.

Branan