Anlage des Repos
This commit is contained in:
19
test/ConvertWord2PDF.ps1
Normal file
19
test/ConvertWord2PDF.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
$documents_path = 'e:\doc2pdf'
|
||||
|
||||
$word_app = New-Object -ComObject Word.Application
|
||||
|
||||
# This filter will find .doc as well as .docx documents
|
||||
Get-ChildItem -Path $documents_path -Filter *.doc? | ForEach-Object {
|
||||
|
||||
$document = $word_app.Documents.Open($_.FullName)
|
||||
|
||||
$pdf_filename = "$($_.DirectoryName)\$($_.BaseName).pdf"
|
||||
|
||||
$document.SaveAs([ref] $pdf_filename, [ref] 17)
|
||||
|
||||
$document.Close()
|
||||
}
|
||||
|
||||
$word_app.Quit()
|
||||
|
||||
#$documents_path = Split-Path -parent $MyInvocation.MyCommand.Path
|
||||
Reference in New Issue
Block a user