Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Access VBA to run Word macro on batch list of files

Access VBA to run Word macro on batch list of files

Access VBA to run Word macro on batch list of files

Hello all,

I have a Word macro which converts a word document to pdf and copies it to a network folder. I would like to code VBA in Access which will go to a specific directory containing a bunch of Word documents and run the macro on each file before returning to the database. Can someone get me started on this? Thank you.


*** UPDATE ***

Okay, I got it working by using fso and a for loop. However, when I run the process it leaves all the Adobe pdf's open. How can I get either my Word macro to convert to pdf without opening Adobe Acrobat, or code Access VBA to close Adobe Acrobat after each file is processed?

My line in macro for the conversion is:
doc.ExportAsFixedFormat path & strFName, wdExportFormatPDF, True, wdExportOptimizeForOnScreen, wdExportFromTo, theStart, theEnd

Any suggestions?

*** UPDATE *** LOL

All I had to do was change True to False in the above line of macro. All good now. I'll leave this here as a reminder of my stupidity...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close