Is there any Microsoft Office API using which we can create empty word, excel and power point files in Swift?

I am looking for an api in Swift(mac os application) which allows me to create empty documents for word, excel and power point.

I would want to initiate the creation of these files via Office because as soon as the files are created, i would want to start the collaboration. We can use touch or FileManager to create empty files however in this case, Office won't start the collaboration after opening them. hence need these documents to be created by Office.

I tried using AppleScript for this purpose where i am explicitly telling to Office apps (Word, Excel and PowerPoint) to create the document, however it fails in below scenarios discovered so far.


1. Renaming the active document to a specific name provided by user

2. When integrated with Xcode, if a document is already open creating another document returns an error while fetching the active document.


let me know if anybody has come across similar requirement.


Please note i would want to avoid using third party library for this purpose.

Posted on Jan 4, 2024 6:05 AM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Is there any Microsoft Office API using which we can create empty word, excel and power point files in Swift?

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