Scripting bridge and generate Microsoft Word header file

后端 未结 1 1576
执笔经年
执笔经年 2021-01-21 19:28

I’m trying to get a Cocoa application to connect to Microsoft Word, and from my search it seems that the only way, is to use Scripting Bridge and generate a word header file. Ho

相关标签:
1条回答
  • 2021-01-21 19:41

    So I found out how to "solve" this issue for Microsoft Word 2011 for Mac, I don't really like it, but it seems to work. The "solution" is based on the discussion I linked:

    The commands are run in the Build Rules, like described and show in Apples exampled (see my first comment for link).

    1. First use the command sdef "$INPUT_FILE_PATH" > word.sdef (INPUT_FILE_PATH is the path to Microsoft Word, which I've dragged into the XCode)
    2. Open the word.sdef file and search for the enumeration named e315 and e183. The enumeration looks like: `
    3. e183 is missing one name field, so I just added a string to it
    4. e315 is missing all its name fields, so I added them
    5. Then use the command cat word.sdef | sdp -fh -o "$DERIVED_FILES_DIR" --basename "$INPUT_FILE_BASE"
    6. A Microsoft Word.h file is now generated and can be used.

    I don't like the the solution, as you have to add strings to the .sdef file manually, however, it seems to work.

    I'll mark it as correct answer, as it solves the issue, but if anyone has better solution do tell.

    0 讨论(0)
提交回复
热议问题