gpt4 book ai didi

vb.net - 如何在 VB.Net 中使用 Adob​​e Indesign API

转载 作者:行者123 更新时间:2023-12-01 02:26:23 24 4
gpt4 key购买 nike

我有一个用于 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"), True), 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在你的 list 中。它将默认为 Copy Local = False .

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

关于vb.net - 如何在 VB.Net 中使用 Adob​​e Indesign API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16034635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com