Inserting File into Word Document
using powershell, i'm trying embed zip file word document embedded file displayed icon.
so far, have been able insert verbiage of text file using following code...
---------------------------------------------------------
$objword = new-object -comobject word.application
$objword.visible = $false
$objdoc = $objword.documents.open('c:\test\example.doc')
$selection = $objword.selection
$objrange = $objdoc.bookmarks.item("txtinsertfile").range
$objdoc.bookmarks.add("newbookmark",$objrange)
$bookmark = $objdoc.bookmarks._newenum | ?{$_.name -eq "newbookmark"}
$bookmark.range.insertfile("c:\test\text.txt")
---------------------------------------------------------
possibly shouldn't using insertfile? there option?
thanks help!
hi littlemissmagic,
i have not found exact script, maybe can try inlineshapes.addoleobject method.
reference from:
i hope helps.
Windows Server > Windows PowerShell
Comments
Post a Comment