Ms word 如何在Word for iPad中获取所选图像的base64表示形式

Ms word 如何在Word for iPad中获取所选图像的base64表示形式,ms-word,office-js,Ms Word,Office Js,我在开发的加载项中获取Word iPad上的选定图像时遇到问题。我正在使用以下代码: Word.run(function (context) { // Getting the selected range var range = context.document.getSelection(); // Getting the image from the selected range var picture = range.inl

我在开发的加载项中获取Word iPad上的选定图像时遇到问题。我正在使用以下代码:

Word.run(function (context) {

        // Getting the selected range
        var range = context.document.getSelection();

        // Getting the image from the selected range
        var picture = range.inlinePictures.getFirstOrNullObject();
        context.load(picture);

        // Loading the image properties so we can access it later
        return context.sync().then(function () {                
            var picbase64 = picture.getBase64ImageSrc();
            return context.sync().then(function () {                    
                console.log("Base64 string is " + picbase64.value);                    
            }); 

        });
})
这段代码在Word for Windows、Word Online和Word for Mac中都能很好地工作,但在Word for iPad中不起作用。我得到以下错误:

Base64字符串未定义

经过进一步调查,我发现Word for iPad显然以不同的方式解释了所选图像(而不是像
InlinePicture
)。所以,问题是如何在Word for iPad中获得所选图像的base64表示


一个注意事项-我试图访问的图像是通过Word插入的。当我以编程方式插入图像(
InlinePicture
)时,我可以毫无问题地访问它

根据文档,对象的
inlinePictures
属性添加到API需求集中,Office for iPad 1.18或更高版本支持该属性。你在关注哪个版本的Office 2016 For iPad?KimBrandl,我有Word 2.5(170904)在这种情况下,这听起来像是API的一个bug。我看不出你的代码有任何问题;它在Windows桌面上运行良好,应该可以在所有平台上运行。产品团队使用GitHub存储库跟踪/管理与Office.js API相关的问题。我建议您在那里报告此问题,并包含指向此堆栈溢出帖子的链接,以便在问题解决后更新此帖子。故障排除过程。@KimBrandl,感谢您的回复。我创造了一个新的问题: