powershell - Appending data at the end of an existing MS Word Document (.doc and .docx) -
i have 500 word documents (some in .doc , others in .docx) need add signature line bottom of each document. these documents saved on sharepoint. looking way automate process. prefer doing in batch or powershell script or through inbuilt functionality within sharepoint. ideas helpful.
thanks!
this might not fastest way able it.
you create bat file opens word files starts wsf file targets word window , sends keys saves it.
the wsf this.
<package> <job id="vbs"> <script language="vbscript"> set wshshell = wscript.createobject("wscript.shell") wshshell.appactivate "word.exe" wscript.sleep 100 wshshell.sendkeys "^{end}" wscript.sleep 500 wshshell.sendkeys "{enter}" wscript.sleep 500 wshshell.sendkeys "name" wscript.sleep 500 wshshell.sendkeys "{enter}" wscript.sleep 500 wshshell.sendkeys "phone number" wscript.sleep 500 wshshell.sendkeys "{enter}" wscript.sleep 500 wshshell.sendkeys "email address" wscript.sleep 500 </script> </job> </package>
the ^{end} makes go bottom of document send enter key go down row inside "" going entered on line. when ready save file send ^s open next file. actually, thinking use vbs script open each of files , loop part... not going write whole file should give go on.
if not familier vbs bat , wsf method little easier. see reference on how use them together. can batch file tell program save file as? (if how)
Comments
Post a Comment