How to copy word page from file to new word file with powershell?

Filip 831 Reputation points
2021-04-27T10:54:16.533+00:00

Hello.
Is there way how to copy some range of pages from word document to other word document with powershell?

I created this word document but i wanna copy here page from other word document. Is it possible?

$Filename='C:\test.docx'
$Word=NEW-Object -comobject Word.Application
$Document=$Word.documents.open($Filename)

Thanks for answare.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,536 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 110K Reputation points MVP
    2021-04-27T17:48:31.65+00:00

    Hi @Filip ,

    maybe this helps:
    https://devblogs.microsoft.com/scripting/hey-scripting-guy-how-can-i-copy-a-portion-of-a-microsoft-word-document-to-a-new-microsoft-word-document/

    Or this one:
    https://gist.github.com/bungard/0d3f76a0216a2ac7c3d5

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.