developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks




Inserting Picture Into Word Document
Laura L Clingan 10/24/2007 02:13 PM
Applications Development 6.0.2 CF2 Windows 2003


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.

Go back