我在 visio 2007 中维护一组流程图。为了查看,我将文件保存为 HTML 并将它们发布到 Web 服务器上。
它工作得很好,但是维护起来真的很痛苦(a paintain;-)。
我正在寻找一种方法来执行此操作,作为某种批处理作业,目前的过程是:
- 打开每个文件
- 文件>另存为网页
- 在另存为网页对话框中 :
- 选择位置
- 发布>>打开新对话
- 更改标题(我不介意是否必须错过这一步)
- 选择网页将其插入(我的模板)
- 完成
我可用的工具有:
- Visual studio 2010 express(我更喜欢c# 但无论如何)
- Visio 2007(我有另一台带有 visio 2010 的笔记本电脑,我也可以使用它,但源文件将是 2007 - 目前没有改变)
- Ruby - 如果不需要 Office 集成,可能会更容易。
(顺便说一句,我知道 OSS 2010 中的流程存储库,并且我已经使用 visio 2010 Web 图表对其进行了测试 - 它有效,并且对于任何有选择的人来说可能是一个更好的选择,尽管它并不完美)
(批处理文件或命令行也可以很酷,但我还没有找到从命令行另存为网页的方法)
I am maintaining a set of process diagrams in visio 2007. For viewing I save the files as HTML and publish them on a web server.
It works great but its a real pain to maintain (a paintain ;-).
I am looking for a way to do this as some kind of batch job, currently the process is:
- open each file
- file>save as web page
- in the save as web page dialogue:
- select location
- publish > open new dialogue
- change title (i dont mind if i have to miss that step)
- select web page to insert it into (my template)
- done
The tools I have availiable are:
- Visual studio 2010 express (i prefer c# but whatever)
- Visio 2007(i have another laptop with visio 2010 which i can use too but the source files will be 2007 - that's not changing for the moment)
- Ruby - may be easier if it doesn't require office integration.
(BTW I know about process repository in OSS 2010 and i have tested it with visio 2010 web diagrams - that works and would probably be a better option for anyone who has the choice, though its not perfect)
(batch file or command line would also be cool but i have not found a way of saving as web page from command line)
发布评论
评论(2)
您可以使用 Visio 的 COM 互操作 API 来完成您想要的操作(我认为)。我首先在手动执行导出时录制宏,然后查看生成的 VBA 代码。然后,如果您想要可以使用命令 shell 调用的内容,则可以在 C# 或 VBScript/VB6 中对其进行调整。
You can use Visio's COM interop API to do what you want (I think). I'd start by just recording a macro while manually doing the export, and then look at the VBA code that generates. You could then adapt that in C#, or VBScript/VB6 if you want something you can call with a command shell.
正如 Jon 强调的那样,有一个完整的 API 可用于通过代码使用 SaveAsWeb 功能。我不久前写了一篇关于它的文章,您可以在这里看到:
http://visualsignals.typepad.co.uk/vislog/2010/03/automating-visios-save-as-web-output.html
该帖子是基于 VBA,但 .net 版本非常相似,Visio 2010 SDK 中也有示例:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=12365
As Jon highlights, there's a whole API for using the SaveAsWeb functionality from code. I wrote a post about it a little while ago, which you can see here:
http://visualsignals.typepad.co.uk/vislog/2010/03/automating-visios-save-as-web-output.html
The post is VBA based but the .net version is very similar and there's also examples in the Visio 2010 SDK:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=12365