Hi,
This script works fine for me.
$word = New-Object -ComObject Word.Application
$doc = $word.Documents.Open('c:\text.docx')
$Missing = [System.Reflection.Missing]::Value
$BackGround = 0
$Append = 0
$Range = 4
$OutputFileName = $Missing
$From = $Missing
$To = $Missing
$Item = 0
$Copies = 1
$Pages = "2-4"
$word.printout([ref]$BackGround, [ref]$Append, [ref]$Range, [ref]$OutputFileName, [ref]$From, [ref]$To, [ref]$Item, [ref]$Copies, [ref]$Pages)
$doc.close($false)
$word.Quit()
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($doc)
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($word)
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.