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

xiejava1018 xiejava1018 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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
...全文
评论 4
收藏 已收藏
分享
返回顶部
xiejava1018
xiejava1018 优质创作者: 人工智能技术领域 优质创作者: 人工智能技术领域
JavaScript 87,983 成员 224,681 内容