$wdFormatHTML = 8 $iPath = "D:\Desktop\*" $oPath = "D:\Desktop\test" $ext = "docx" $targetDocs = Get-ChildItem -Path $iPath -Include "*.$ext" $word = new-object -comObject "Word.Application" $word.Visible = $false foreach($doc in $targetDocs){ $word.Documents.Open($doc.fullname) | Out-Null $outFileName = (Join-Path $oPath $doc.name).Replace($ext,"html") $word.Application.ActiveDocument.SaveAs2([ref]$outFileName,[ref]$wdFormatHTML) $word.Application.ActiveDocument.Close() } $word.Quit() |
0 件のコメント:
コメントを投稿