首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在VB.Net中使用Adobe Indesign API

如何在VB.Net中使用Adobe Indesign API
EN

Stack Overflow用户
提问于 2013-04-16 18:24:45
回答 1查看 2.8K关注 0票数 4

我有一个excel的示例插件:I create a object InDesign.Application

代码语言:javascript
复制
        Dim myInDesign As InDesign.Application
        Dim myDoc As InDesign.Document
        Dim myPage As InDesign.Page

        myInDesign = CType(Activator.CreateInstance(Type.GetTypeFromProgID("InDesign.Application"), True), InDesign.Application)
        myDoc = myInDesign.Documents.Add    
        myDoc = myInDesign.ActiveDocument

InDesign将打开,但附加模块在以下位置显示错误:

代码语言:javascript
复制
`myInDesign = CType(Activator.CreateInstance(Type.GetTypeFromProgID("InDesign.Application"), True), InDesign.Application)`

错误内容:

代码语言:javascript
复制
Unable to cast COM object of type 'System.__ComObject' to interface type 'InDesign.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{ABD4CBB2-0CFE-11D1-801D-0060B03C02E4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

为什么?你能帮帮我吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-09 04:10:57

您是否使用vb.net的com接口添加了对InDesign类型库的引用?

在Visual Studio中打开引用面板并选择"COM“选项卡,然后在列表中查找InDesign。它将默认为Copy Local = False

现在,您可以像编写vbs一样使用COM函数。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16034635

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档