VBScript to use MODI for merging multiple MDI files

R

Ronny Hamida

Hi there!

I was recommended to this discussion group to see if someone could assist me.

I'm trying to create a VBScript that will open each MDI file in the current
folder and then add ALL pages from each MDI file into one big MDI file. What
I have created is as follows:

-----
Dim fso, MdiDoc, f, OutName

Set fso = CreateObject("Scripting.FileSystemObject")
Set MdiDoc = CreateObject("MODI.Document")

For Each f In fso.GetFolder(".").Files
If InStr(LCase(f.Name), ".mdi") > 0 Then
MdiDoc.Create f.Path
MsgBox f.Path

MdiDoc.SaveAs OutName
MdiDoc.Close
End If
Next

-----

Unfortunately I am stuck on two areas. 1) Not sure how I can define the
file OutName so that I can eventually save the file (and where do I put this
line), and 2) Which MODI method can I use to add ALL of the images from one
MDI file to another? Originally, I tried to use something like
"DestinationFile.Images.Add SourceFile.Images(0), Nothing" but this only does
the first page of the SourceFile document (and there could be more than one).

I'm thinking that I just need to scrap the entire thing above and create
something complete different. Can anyone help with this?

Alternatively, I would even like to see what the code would look like if it
were just VB and not VBScript, but that's not really important right now! :)

Thanks in advance to anyone who can help!


Ronny
 

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