谁能把这段代码翻成javascript的。救急!!!

xiejava1018
人工智能领域优质创作者
2002-10-25 09:41:23
Sub OpenVisio()
Dim appVisio As Visio.Application
Dim docsObj As Visio.Documents
Dim docObj As Visio.Document
Dim stnObj As Visio.Document
Dim mastObj As Visio.Master
Dim pagsObj As Visio.Pages
Dim pagObj As Visio.Page
Dim shpObj As Visio.Shape
Try
appVisio = CreateObject("Visio.Application")
docsObj = appVisio.Documents
'Create a document based on the Basic Diagram template that automatically
'opens the Basic Shapes stencil.
docObj = docsObj.Add("Basic Diagram.vst")
pagsObj = appVisio.ActiveDocument.Pages
'A new document always has at least one page, whose index in the Pages collection is 1.
pagObj = pagsObj.Item(1)
stnObj = appVisio.Documents("Basic Shapes.vss")
mastObj = stnObj.Masters("Rectangle")
'Drop the rectangle in the approximate middle of the page.
'Coordinates passed with the Drop method are always inches.
shpObj = pagObj.Drop(mastObj, 4.25, 5.5)
'Set the text of the rectangle
shpObj.Text = "Hello World!"
'Save the drawing and quit Visio. The message pauses the program
'so you can see the Visio drawing before the instance closes.
docObj.SaveAs("hello.vsd")
MsgBox("Drawing finished!", , "Hello World!")
appVisio.Quit()
Catch e As Exception
Debug.Write(e.Message)
End Try
End Sub
...全文
45 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiejava1018 2002-10-25
  • 打赏
  • 举报
回复
高手就是高手啊。谢谢!:)
qiushuiwuhen 2002-10-25
  • 打赏
  • 举报
回复
<script>
function openVisio(){
var appVisio = new ActiveXObject("Visio.Application")
var docsObj = appVisio.Documents
var docObj = docsObj.Add("Basic Diagram.vst")
var pagsObj = appVisio.ActiveDocument.Pages
var pagObj = pagsObj.Item(1)
var stnObj = appVisio.Documents("Basic Shapes.vss")
var mastObj = stnObj.Masters("Rectangle")
var shpObj = pagObj.Drop(mastObj, 4.25, 5.5)
shpObj.Text = "Hello World!"
docObj.SaveAs("hello.vsd")
alert("Drawing finished")
appVisio.Quit()
}
</script>
<input type=button value=openVisio onclick=openVisio()>
qiushuiwuhen 2002-10-25
  • 打赏
  • 举报
回复
必须客户端也要有visio的呀
xiejava1018 2002-10-25
  • 打赏
  • 举报
回复
我想在客户端打开一个Visio编辑器。有无办法?

87,937

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧