在VBA中引用自定义快速部件构建块 [英] Referencing Custom Quick Parts Building Blocks in VBA

查看:73
本文介绍了在VBA中引用自定义快速部件构建块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我的模板包含各种自定义快速部件构建块"customQP.dotx"。


我希望能够在使用VBA时引用这些构建块但却无法弄清楚如何。


设置objBB = objTemplate.BuildingBlockEntries(&"CustomBB1")返回此错误" ;请求的集合成员不存在。"


我已确认构建块确实存在。 我还确认这种语言有效,因为它将从MS Word的基本构建块文件返回构建块。


如何在自定义文件中引用构建块?


提前致谢!

解决方案

您好,


您的问题是差不多3个月了 - 但是如果你还没找到解决方案的话。我认为答案隐藏在此页面上的代码示例后面的文本中: 


http://msdn.microsoft.com/en-us/library/ff837526(v = office.14).aspx


据我了解,在您的示例中,可能是第二个和第三个以及......"CustomBB1"。在同一模板中 -  所有具有其他类别和/或类型的模板。因此,"CustomBB1"不是构建块的唯一标识符。你宁愿
也必须提供类型和类别。


希望这有助于回答你的问题。



Hello,

I have a template that contains a variety of custom quick parts build blocks "customQP.dotx".

I want to be able to reference these building blocks while using VBA but have been unable to figure out how.

Set objBB = objTemplate.BuildingBlockEntries("CustomBB1") returns this error "The requested member of the collection does not exist."

I have confirmed that the build block does exist.  I have also confirmed that this language works because it will return build blocks from MS Word's base build blocks file.

How do I reference the building blocks in my custom file?

Thanks in advance!

解决方案

Hi,

your question is almost 3 months old - but in case you didn't find the solution yet. I think the answer ist hidden in the text following the code example on this page: 

http://msdn.microsoft.com/en-us/library/ff837526(v=office.14).aspx

As i understand it, in your example there could be a second and third and ... "CustomBB1" in the same template - all which have another category and/or type. Therefore "CustomBB1" is not an unique identifier for the building block. You rather have to also provide the type and category.

Hopefully this helps answering your question.


这篇关于在VBA中引用自定义快速部件构建块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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