Inserting a picture in the correct position

M

Mike

Hi All

I have a lotus script running from lotus Notes to create
word documents and all works fine using vb code.

My problem is i am inserting a signature but it always
appears at the top left of the document.

my insert command that does work in lotus script is:

WordApp.ActiveDocument.InlineShapes.AddPicture
("c:\temp\signature")

now i know Lotus Script is a little different but the
principals are the same (in a way, but has anyone got any
idea how i can position this signature in the correct
spot.

i.e. any code out there that may help me?
and i did try the lotus forums they sent me here :)

Thanks

Mike
 
P

Peter Hewett

Hi Mike

You need to create and define a range object to specify where in the
document you want to insert your picture/signature. By default (which is
what you're getting) Word will insert your picture at the start of the
document. The easy way around this is to use a bookmark in the
template/document to specify the signatures location. Lets assume you've
added a bookmark called "Signature". Then try the following code:

Sub InsertSignature()
Dim rngSignature As Word.Range

Set rngSignature = ActiveDocument.Bookmarks("Signature").Range
rngSignature.InlineShapes.AddPicture FileName:= _
"F:\My Templates\Marketing Impact\Signatures\106.TIF", _
LinkToFile:=False, SaveWithDocument:=True
End Sub

If you're not using Word from VBA you'll have to prefix objects with your
WordApp object.

I hope this helps + Cheers - Peter
 

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