PaulRahoi

Open/Convert ALL files in a directory...???

5 posts in this topic

I have thousands of old PageMaker files which I want to dump in a directory, and open/save each one of them as PDF or HTML-- anything but PageMaker, which is a dead format going forward.

But for the sake of simplicity, I would simply like to see an .au3 module which does something like this:

  1. Loops through every file in a directory (assume they are all Microsoft Word files).
  2. Opens each one with Microsoft Word.
  3. Saves each one in the same directory as PDF or the older 97-2003 Word format (just something different).

I looked in the "AutoIt Example Scripts" but didn't see anything like this...  Can anyone point me to such an example, or simply create one (if it is not too difficult)?  I am totally new to AutoIT, so any help would be greatly appreciated.

Thanks in advance,

Paul.

Share this post


Link to post
Share on other sites



Use the Word UDF to open the file, and save it to PDF :

#include <Word.au3>

Local $oWord = _Word_Create(False)
Local $oDoc = _Word_DocOpen($oWord, @ScriptDir & "\theFile.doc")
_Word_DocSaveAs($oDoc, @ScriptDir & "\theFile.pdf", $wdFormatPDF)
_Word_Quit($oWord)

 

Share this post


Link to post
Share on other sites

Thanks, but... the "Word" example was just for the sake of an example (because everyone has Word on their PC, and could thus help me with such an example).

What I REALLY want is (ultimately) PageMaker.  But for now, I'm looking for an example in Word (or WordPad, whatever).

And they key point is the LOOPING through all files in a directory.

Anyone?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@PaulRahoi, for the looping look at _FileListToArray, or _FileListToArrayRec (depending on your needs for a recursive search) in the help file. The examples should speak directly to what you're trying to do.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

@PaulRahoi, for the looping look at _FileListToArray, or _FileListToArrayRec (depending on your needs for a recursive search) in the help file. The examples should speak directly to what you're trying to do.

That helps.  Thanks.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now