[APAC] 이미지를 Word로 가져온 다음 규칙에 따라 이름(2/2)

3566 단어 word
# docx 
Set-ItemProperty -Path "e:\screenshot\*.docx" -Name IsReadOnly -Value $false
# 
$target = "e:\screenshot"
$pw = ConvertTo-SecureString ' ' -AsPlainText -Force
$Creds = New-Object -Typename System.Management.Automation.PSCredential -Argumentlist "apac\814072", $pw
New-PSDrive -Name P -PSProvider FileSystem -Root "\\10.103.22.39\c$\ScreenShot" -Credential $Creds
Get-ChildItem -Path P:\ | Move-Item -Destination $target -Force
Remove-PSDrive -Name P
# 
$filename = (Get-Date).Tostring("yyyyMMdd")
# word , Add-OSCPicture 
$objWord = New-Object -ComObject Word.Application
$objWord.Visible = $false
$objDoc = $objWord.Documents.Add()
$objSelection = $objWord.Selection
$objDoc.SaveAs([ref]"e:\screenshot\$filename",[ref]16)
$objword.Quit()
# Add-OSCPicture, word
Add-OSCPicture -WordDocumentPath "e:\screenshot\$filename.docx" -ImageFolderPath "e:\screenshot\"
# JPG 
#Get-ChildItem -path *.JPEG | Remove-Item

좋은 웹페이지 즐겨찾기