一个用PowerShell打开文档并将其另存为的脚本
程序员文章站
2022-09-02 21:26:49
[plain
$wdApp = New-Object -Com Word.Application
$wdApp.Visible = $true
$Fi...
[plain
$wdApp = New-Object -Com Word.Application
$wdApp.Visible = $true
$File1 = '*****************************'
$File2 = '*****************************'
$wdDoc = $wdApp.Documents.Open($File1)
$wdFormatDocumentDefault = 16
$wdDoc.SaveAs2([ref]$File2,[ref]$wdFormatDocumentDefault)
$wdApp.Quit()
$wdApp = New-Object -Com Word.Application
$wdApp.Visible = $true
$File1 = '*****************************'
$File2 = '*****************************'
$wdDoc = $wdApp.Documents.Open($File1)
$wdFormatDocumentDefault = 16
$wdDoc.SaveAs2([ref]$File2,[ref]$wdFormatDocumentDefault)
$wdApp.Quit()
上一篇: 正则表达式简介(13)