“找到了具有相同名称的多个对象。” [英] "Multiple objects with the same name were found."

查看:99
本文介绍了“找到了具有相同名称的多个对象。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的word文档中有一些带ID的项目。这些项目位于文档的正文,页眉和页脚部分。我使用富文本内容控件的title属性为所有5个ID添加了一个ID。每个ID毫无疑问都是唯一的
(我也尝试重新添加它们并尝试使用不同的ID。

I have a few items with IDs in my word document. The items are located in the body, header and footer section of the document. I have added an ID to all 5 of them using the title property of the rich text content control. Each ID is without a doubt unique (I have also tried re-adding them and tried with different IDs.

我得到的结果会不时变化;有时除了一个人能够绑定,有时无法绑定。

The result I get varies from time to time; sometimes all except one is able to bind, sometimes none are able to bind.

我得到的错误是: 

The error I get is: 


"找到了具有相同名称的多个对象。"

"Multiple objects with the same name were found."

有些项似乎只是选择不绑定。

Some items it seemingly just chooses not to bind.

非常沮丧,有人看到我做错了吗?

Extremely frustrated, anyone see what I'm doing wrong?

代码用于绑定:

Office.context.document.bindings.addFromNamedItemAsync("DocumentID", Office.BindingType.Text, { id: "DocumentID" }, onBindingsCreated);
        Office.context.document.bindings.addFromNamedItemAsync("System", Office.BindingType.Text, { id: "System" }, onBindingsCreated);
        Office.context.document.bindings.addFromNamedItemAsync("Discipline", Office.BindingType.Text, { id: "Discipline" }, onBindingsCreated);
        Office.context.document.bindings.addFromNamedItemAsync("DocumentType", Office.BindingType.Text, { id: "DocumentType" }, onBindingsCreated);
        Office.context.document.bindings.addFromNamedItemAsync("RevisionNo", Office.BindingType.Text, { id: "RevisionNo" }, onBindingsCreated);
    }

推荐答案

嗨SteffenO,

Hi SteffenO,

>> "找到了具有相同名称的多个对象。"

>> "Multiple objects with the same name were found."

根据错误消息,似乎存在多个具有相同名称的内容控件,并且设置了碰撞失败为真。但是,根据您的描述,您添加了五个具有不同title属性的内容控件。你能和我们分享你如何
添加五个内容控件吗?我做了一个测试,如果我通过手动添加它们逐个添加内容控件,它就能正常工作。但是一旦我尝试选择内容控件并复制它,我没有看到复制控件的视图,但是此时,如果我尝试使用addFromNamedItemAsync,
,我得到了和你一样的错误。

Based on the error message, it seems that more than one content control with the same name exists, and fail on collision is set to true. But, based on your description, you add five content control with different title property. Could you share us how you add the five content controls? I made a test, if I add the content control one by one by manually adding them, it worked correctly. But once I tried to select the content control, and copy it, I did not see the view of the copied control, but at this time, if I try to use addFromNamedItemAsync, I got the same error like yours.

首先,我建议您删除所有内容控件,然后手动添加内容控件而不复制。

First of all, I suggest you remove all of the content controls, and then add the content controls manually without copying.

希望它会有所帮助。

最诚挚的问候,

Edward


这篇关于“找到了具有相同名称的多个对象。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆