Santana Posted June 11, 2009 Share Posted June 11, 2009 Hi all, Is there any way to have a script that loops through a bunch of images in a folder, then open a word document and paste each image in a folder into a separeate document? I have images in a directory and need to add a header in a word document and paste the image below the header. This process needs for every image in the directory, one document with a different header. can anyone give me an idea of how to go about it? Thanks Just another special date with a different challenge Link to comment Share on other sites More sharing options...
Santana Posted June 11, 2009 Author Share Posted June 11, 2009 Hi all, me again. I was able to find a vba script that opens a word document, create a table and place an image inside the table. At least thats a start. can anyone help me translate this code into autoit code? Thanks. Dim WordApp1 As Word.Application Dim WordDoc1 As Word.Document Dim myRange As Word.Range Set WordApp1 = CreateObject("Word.Application") WordApp1.Visible = True Set WordDoc1 = WordApp1.Documents.Add With WordDoc1 Dim myTable As Word.Table Set myRange = .Range(Start:=0, End:=0) Set myTable = .Tables.Add(Range:=myRange, NumRows:=2, NumColumns:=1) myTable.Cell(2, 1).Range.InlineShapes.AddPicture "H:\Process Flow\result\sample.TIF" End With WordApp1.Quit False Set WordApp1 = Nothing Set WordDoc1 = Nothing Just another special date with a different challenge Link to comment Share on other sites More sharing options...
oMBRa Posted June 11, 2009 Share Posted June 11, 2009 look for _WordDocAddPicture in the help file Link to comment Share on other sites More sharing options...
Santana Posted June 11, 2009 Author Share Posted June 11, 2009 Hey, Thanks for the input. I will take a look at it. Just another special date with a different challenge Link to comment Share on other sites More sharing options...
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