Inserting Picture Into Word Document

Ok - I’ve been all over the forum mining information about inserting pictures into Word documents, exporting to Word, etc. I’m stuck…

I’m creating a letter in Notes using a form and then I copy the letter into Word. I need to insert a logo…which I’m able to do by putting the logo into a temp file and grabbing it when I create the Word doc. The problem is that I cannot get the logo placed where I want it in the doc. I need it to be at the top of the 2nd page…how hard could that be? Well, when I get it working it always ends up right after the first bit of text on the cover page (1st page)…when I don’t get it working I get an error: Word: BAD PARAMETER. Not sure why I’m getting that (sometimes). I have recorded macros in Word to get a clue but no help.

Here’s what I have at this point (obviously only an excerpt)

Const wdLine = 5

Const wdScreen = 7

'Save Word Document in temp file and close Word

Call WordDoc.SaveAs("c:\\temp\ReviewLetter.doc")

MSWord.Selection.MoveDown wdScreen

MSWord.Selection.MoveDown wdScreen

MSWord.Selection.MoveDown wdScreen

MSWord.Selection.InlineShapes.AddPicture "C:\temp\LogoTOF.jpg", False, True

Call WordDoc.Close

I’ve tried variations including MoveDown wdLine with and without the wdScreen.

Any help?

Thanks

p.s. Originally I had the logo as part of the form but after exporting the logo is very poor quality which is why (after reading other posts concerning that issue) I decided to insert the logo AFTER the export.

Subject: Inserting Picture Into Word Document

You could use a bookmark at the location where you want to insert the image and then tell work to go to the bookmark. This is assuming that you have a template document from which you are working and not a one-off situation.

bookmarkName = “LogoLocation”

MSWord.Selection.GoTo(wdGoToBookmark, , ,bookmarkName)

MSWord.Selection.InlineShapes.AddPicture “C:\temp\LogoTOF.jpg”, False, True

MSWord.Selection.TypeParagraph

Alternatively, you can also use

pageNumber = “2”

MSWord.Selection.GoTo(wdGoToPage, wdGoToNext,pageNumber) 'Or use 1 for wdGoToPage, and 2 for wdGoToNext

MSWord.Selection.InlineShapes.AddPicture “C:\temp\LogoTOF.jpg”, False, True

MSWord.Selection.TypeParagraph