How to create a macro on a Mac that opens and does a SavesAs on all files in a folder?

Anonymous
2023-01-18T01:39:42+00:00

I have several hundred Word files that need to be opened, saved in .odt format, then re-opened and saved in .docx (This eliminates an error message I get every time I open the files). I have very limited experience coding in VBA, so I am not sure how to structure the macro. I would be grateful for your help in automating this process through the use of a macro.

Thank you.

Microsoft 365 and Office | Word | For home | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

16 answers

Sort by: Oldest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Anonymous
    2023-01-18T16:03:17+00:00

    Thank you Snow. This will really help us toward a solution. Now maybe someone who knows VBA for Mac can help translate your work.

    Thank you!

    Chip

    Was this answer helpful?

    0 comments No comments
  3. John Korchok 237.1K Reputation points Volunteer Moderator
    2023-01-18T18:00:08+00:00

    There are 2 issues with this code for a Mac. The minor issue is the path separator, which needs to be "/" instead of "".

    Depending on your version of Office, the Dir function could be an issue. It's been fixed in Excel for Mac 2019 and Excel 365, but does not work in earlier versions. I haven't tested whether Dir is working in Word VBA. Here is Ron de Bruin's page about this issue: Dir function in macOS

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2023-01-18T19:15:41+00:00

    Snow,

    I cut and pasted the Macro you posted and put it into Word on my Mac and ran it. There were no compile error on the front end. It did seem to go through all the files in the folder, but it only processed the .pdfs for some reason. It didn't appear to do anything to the docx or out files.

    Chip

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-01-18T20:26:02+00:00

    John,

    Thanks for the reply. I didn’t see which line has the slash reversed. Can you be more specific?

    I am running the most current version of Word that comes with the office 365 subscription. I didn’t get any compile errors when I tried to run Snow’s macro on my Mac. That said, it did not perform the routines as expected.

    Was this answer helpful?

    0 comments No comments