使用 C# 创建和保存 Visio 2010 模具
我们需要使用 .NET Freamework 和 C# 在代码中创建 Visio 2010 模具。
这个想法是这样的:
我们有我们的应用程序,由应用程序用户使用,然后我们有工作流设计器,该用户 Visio 安装在另一台计算机上。
所以我们有两个不同的人和两台不同的机器。可以说,对于本次讨论,该应用程序是一个组织结构应用程序,其对象模型由各种类型组成,包括用户、组、开发人员、管理员等。
我想向应用程序添加功能,以允许应用程序用户获取这些类型并从中创建模板,保存在 .vss 文件中,该文件是 Visio 用于模板的格式。然后,Visio 用户可以获取此 vss 文件并将其添加到他正在处理的文档中。所有这一切背后的想法是应用程序用户可以随时添加用户类型,例如“高级用户”,这使得所有这些过程都是动态的。
现在,安装应用程序的计算机没有安装 Visio,我想这可能很重要,因为可以从应用程序引用与 visio 编程相关的程序集。
这能实现吗?
谢谢,
阿维
We need to create a Visio 2010 stencil in code, using the .NET Freamework and C#.
The idea is like this:
We have our app, that is used by the app user, and then we have the workflow designer, which user Visio which is installed on another machine.
So we have two different people and two different machines. Lets say that, for this discussion, the application is an organizational structure app, that its object model comprises of various types, including User, Group, Developer, Administrator etc..
I want to add functionality to the app that would allow the app user to take these types and create a stencil from it, saved in a .vss file which is the format Visio uses for stencils. Then, the Visio user can take this vss file and add it to the document he's working on. The idea behind all this is that the app user can add user types any time, say 'Power User', which makes all this process dynamic.
Now, the machine where the application is installed doesn't have Visio installed, which might be important, i guess, in terms of what assemblies related to visio programming can be referenced from the app.
Can this be achived?
Thanks,
Avi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要在无法使用 Visio API 的计算机上(即未安装 Visio 或在服务器方案中)创建 Visio 模具,您可以创建 Visio XML 文件。如果您使用文件扩展名 VSX,则 Visio 会将其视为模具。在 Visio XML 文件中创建形状可能比使用 API 创建形状复杂得多,因为您需要自己管理 Visio 通常负责的许多事情,例如集合 ID、公式计算、连接创建等。
此方法假定定义使用形状的几何图形或图像是预定义的,可以从模板生成代码中访问。如果创建模板的用户需要指定几何形状,那么您可能需要集成一些绘图工具。 Visio 可能就是该工具,或者您可以研究其他绘图工具,它们可以创建 Visio 可以读取的文件,例如 SVG。
If you want to create a Visio stencil on a machine where you can't use the Visio API (i.e. where Visio is not installed or in a server scenario) you can create a Visio XML file. If you use the file extension VSX then Visio will treat it as a stencil. Creating shapes in a Visio XML file may be much more complicated than creating shapes using the API because you will have manage many things yourself which Visio normally takes care of such as collection IDs, formula evaluation, connection creation, etc.
This approach assumes the definition of the geometry or image to use the shapes is predefined and accessible from your stencil generation code. If the user creating the stencil needs to specify the geometry then you may need to integrate some drawing tool. Visio may be that tool or you could investigate other drawing tools which can create a file which Visio can read, e.g. SVG.