Kohr Posted September 19, 2006 Posted September 19, 2006 I am trying to insert pictures into a Word document using the following code. I have not been able to get "Shapes.AddPicture" to work using several different combinations. Has anyone had any luck with inserting pictures into word? "$word.Selection.Paste" works but it puts the image in as a .bmp file and I will need to insert lots of images. $word = ObjCreate("Word.Application") $word.visible = False $word.Documents.Add Dim $FileName $FileName = "C:\Documents and Settings\All Users\Desktop\dump_full.jpg" $word.Activedocument.Shapes.AddPicture ($FileName, False, True, 0, 0, 0, 0, 0) $word.ChangeFileOpenDirectory( @DesktopDir ) $word.Activedocument.SaveAs( "test.doc" ) $word.Application.Quit Kohr AutoIt LinksAutoIt CrapsGrid_PixelSearchAdvancedPixelGrab
Kohr Posted September 19, 2006 Author Posted September 19, 2006 It is nice when you figure out your own problems. $word.Activedocument.InlineShapes.AddPicture ($FileName, False, True) Kohr AutoIt LinksAutoIt CrapsGrid_PixelSearchAdvancedPixelGrab
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now