Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Trying to convert Word 2016 doc to PDF. The action “Convert Format of Word Documents” encountered an error: “Can’t get item 1 of missing value.” Why is this

Trying to convert Word 2016 doc to PDF. Just get The action “Convert Format of Word Documents” encountered an error: “Can’t get item 1 of missing value.”

It used to work ok, now nothing associated with Office works. Any ideas? Thanks

Posted on Sep 22, 2019 4:55 AM

Reply
7 replies

Sep 22, 2019 5:10 AM in response to daverioja

It sounds like you are using an AppleScript to do the conversion. The AppleScript isn't doing any error checking to confirm that the object exists before trying to get a value from it.


The Office Library may have changed. You will probably have to rewrite the AppleScript to deal with the changes.


Office 2008 provided a set of Automator Actions that were not recreated for 2016 and later.

Sep 22, 2019 5:27 AM in response to daverioja

Although Word 2016 for Windows has a save as PDF, this feature is not in Word 2016 for Mac. The native file format on macOS is PDF, so Word 2016 for Mac should just offer that as export target, or you can get to PDF from the File menu : Print : PDF : Save as PDF.


I do not have access to MS Word on either Windows or Mac to further investigate this. If you want detail controls over the access features within the PDF (e.g. restrict copying, etc.), then you will need to take the Word .docx from Word 2016 and open it in LibreOffice v6.3.1.2 and then export to PDF. That PDF panel allows you to set a second password on these selectable access restrictions before exporting to PDF. Apple's print panel does not give you this latitude in selectable PDF protection.

Sep 22, 2019 5:28 AM in response to Barney-15E

Hi, thanks for the input but I have never used AppleScripts - wouldnt know how to !

I used to just add items from the workflow menu, like "find specific files". " convert Word document (to PDF), etc. And as soon as I added files and press run, Automator did the rest. Now I just get this error. It is so frustrating, as I used to use all the time for converting word and Excel Documents. I wonder if Apple has withdrawn support with office 2016?

Sep 22, 2019 5:33 AM in response to VikingOSX

Hi Viking

I have Office 2016 for Mac and I can convert individual documents to PDF with no problem, using "Save as PDF" in Word. What I can't do is use Automator to batch convert Word files to PDF. I used it successfully for several years and saved the Automator workflows at but it seems since Office 2016 I just get this error message.

Sep 22, 2019 7:05 AM in response to daverioja

You may not have used AppleScripts, but that doesn't mean the Actions provided by Microsoft don't use AppleScript.

As I stated before, those Actions were distributed with a previous version of Office. They may no longer function with the new version of Office or with Automator itself.


The error you are seeing is a common AppleScript error when you try to access an object that has not been instantiated.

Sep 22, 2019 7:09 AM in response to daverioja

Try directly asking the Microsoft Office for Mac support folks. It’s a Microsoft app, after all.


Try the current Office 2019 or Office 365, and try exporting from LibreOffice and OpenOffice as potential alternatives...


The macOS iWork Pages, Numbers and Keynote tools, can also open and read and write many Office documents, so that’s another export path to investigate.


I’ve not had need to use Office in a ~decade and akin to VikingOSX also not using Office, so there are potential alternatives available if Microsoft Support can’t sort this.


Sep 22, 2019 9:41 AM in response to daverioja

Office 2011 (and perhaps 2008) installed Word related Automator actions, including that once familiar, Word to PDF action. I suspect that Office 2016 for Mac no longer provides that action. The action was either written in AppleScript, or Word Basic.


Here is a web link to a complete AppleScript example for exporting a Word .docx to PDF. This can be placed in an Automator Run AppleScript action (as seen below) where you would click the compile button in the action. You want the action before it to pass Word .docx into the following code.


use scripting additions

on run {input, parameters}
repeat with aFile in input
        tell application "System Events"
            set inputFile to disk item (aFile as text)
            set outputFileName to (((name of inputFile) as text) & ".pdf")
        end tell

        tell application id "com.microsoft.Word"
            activate
            open aFile
            tell active document
                save as it file name outputFileName file format format PDF
                close saving no
            end tell
            set defaultPath to get default file path file path type documents path
        end tell

        tell application "System Events"
            set outputPath to (container of inputFile)
            set outputFile to disk item outputFileName of folder defaultPath
            move outputFile to outputPath
        end tell
    end repeat
    return input
end run


Trying to convert Word 2016 doc to PDF. The action “Convert Format of Word Documents” encountered an error: “Can’t get item 1 of missing value.” Why is this

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.