加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-17 07:13:38 所属栏目:百科 来源:网络整理
导读:我有一个excel的示例添加: 我创建了一个对象InDesign.Application Dim myInDesign As InDesign.Application Dim myDoc As InDesign.Document Dim myPage As InDesign.Page myInDesign = CType(Activator.CreateInstance(Type.GetTypeFromProgID("InDesign.A
我有一个excel的示例添加:
我创建了一个对象InDesign.Application

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打开,但加载项显示错误:

`myInDesign = CType(Activator.CreateInstance(Type.GetTypeFromProgID("InDesign.Application"),InDesign.Application)`

错误内容:

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)).

为什么?你能帮助我吗?

解决方法

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

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读