Can't copy MS Word document to my app from iOS Word app

Olivier de Jonge

I want to open a Word file in my app's delegate function with

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options

and by adding to my Info.plist

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>doc</string>
        </array>
        <key>CFBundleTypeIconFile</key>
        <string>AppIcon.icns</string>
        <key>CFBundleTypeName</key>
        <string>Microsoft doc</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.microsoft.word.doc</string>
        </array>
    </dict>
</array>

When I open an email in Google Inbox app with a Word document attached I see my app in the Document Interaction Controller and a copy of the Word file is sent to the delegate function.

But when I open de Document Interaction Controller in the iOS Word app via tapping the "..." behind the Word file in the list of recent files and then: "share" > "send copy" > "send with another app" my app is NOT visible in the Document Interaction Controller.

What should I do more or different to see my app in the Document Interaction Controller of an iOS Word App to edit the Word file in my app?

Olivier de Jonge

It appears that you have to mention in the Info.plist that the LSItemContentTypes conforms to org.openxmlformats.wordprocessingml.document format

so the Info.plist will become:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>doc</string>
        </array>
        <key>CFBundleTypeIconFile</key>
        <string>AppIcon.icns</string>
        <key>CFBundleTypeName</key>
        <string>Microsoft Word</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
          <string>com.microsoft.word.doc</string>
          <string>org.openxmlformats.wordprocessingml.document</string>
        </array>
    </dict>
</array>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

VBA Excel Copy Content From Word Table

来自分类Dev

Open Apple Maps App With Directions from my ios App iOS 9 Swift 2.2

来自分类Dev

IF AND语句在MS WORD中

来自分类Dev

诊断MS Word的瓶颈

来自分类Dev

I am exporting text from a word document and nothing happens

来自分类Dev

How to dismiss a dialog box displayed by MS Word when openning document in Python/Win32

来自分类Dev

MS Word图片标题宏

来自分类Dev

LaTeX用户的MS Word教程

来自分类Dev

MS Word图形编号错误

来自分类Dev

从图像创建MS Word模板

来自分类Dev

用MS Office word邮寄

来自分类Dev

MS Word表格-如何实现

来自分类Dev

在MS Word中创建脚注?

来自分类Dev

MS Word文档中的变量

来自分类Dev

MS Word中的奇怪字符¤

来自分类Dev

MS Word 2010中的目录

来自分类Dev

计算 MS Word 公式值

来自分类Dev

MS Word 宏的权限被拒绝

来自分类Dev

VBA MS Word 表格创建

来自分类Dev

从 Django 填充 MS Word 模板

来自分类Dev

无法从iOS Word应用程序将MS Word文档复制到我的应用程序

来自分类Dev

Copy MathML into Word to use as equation

来自分类Dev

How to upload DevExtreme ios app from windows?

来自分类Dev

Subscribing email address to MailChimp from iOS app

来自分类Dev

How to open the app from the background task in iOS?

来自分类Dev

Can't read PKZip signature validating app for App Store

来自分类Dev

How can I find all text within a word document that matches a pattern and apply formatting on it?

来自分类Dev

.NET替换MS Word @ Server中的书签

来自分类Dev

在Django中生成MS Word文档