首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将VSDX文件批量转换为VSD

将VSDX文件批量转换为VSD
EN

Stack Overflow用户
提问于 2018-02-24 02:39:41
回答 1查看 707关注 0票数 1

有没有什么优雅的方法可以将VSDX文件批量转换为VSD?请注意-这是实际的降级,而不是相反。它可以通过脚本来实现吗?或者我被第三方工具抛弃了..?万分感谢,亲切问候

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-02-24 06:52:23

Visio文件中的VBA宏将执行此操作...

代码语言:javascript
复制
Sub Converter()
Dim StrFile As String
    Dim objFSO, destRow As Long
    Dim mainFolder, mySubFolder
    Dim fullPathFileName
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    mFolder = "C:\Users\sivancik001\Desktop\vsdx\" ' <<<< PATH TO BE CHANGED !!!!
    Set mainFolder = objFSO.GetFolder(mFolder)
    StrFile = Dir(mFolder & "*.vsdx*")
    'Do While Len(StrFile) > 0
        '... actions here ... but not needed as nothing should be in the root folder. files are in subfolders
        'StrFile = Dir
    'Loop
    For Each mySubFolder In mainFolder.SubFolders
        StrFile = Dir(mySubFolder & "\*.vsdx*")
        Do While Len(StrFile) > 0
            fullPathFileName = mySubFolder & "\" & StrFile
            'MsgBox fullPathFileName
            Application.Documents.Open fullPathFileName
            Application.ActiveDocument.SaveAs Left(fullPathFileName, Len(fullPathFileName) - 1)
            Application.ActiveDocument.Close
            Kill fullPathFileName
            StrFile = Dir
        Loop
    Next
End Sub
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48954293

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档