0
votes

I have about 500 word documents (some in .doc and others in .docx) where I need to add a signature line to the bottom of each document. These documents are saved on Sharepoint. I am looking for a way to automate this process. I would prefer doing it in batch or powershell script or through any inbuilt functionality within Sharepoint. Any ideas would be helpful.

Thanks!

1
you'll need jscript/vbscript/powershell or .net to do this.npocmaka

1 Answers

1
votes

This might not be the fastest way to do it but this would be able to do it.

You could create a BAT file that opens the word files starts a WSF file that targets the word window and sends keys to it then saves it.

The WSF could look something like 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 you go to the bottom of the document then you send enter key to go down a row then anything inside "" is going to be entered on that line. When you are ready to save the file send ^s then open the next file. Actually, now that I am thinking about it you could just use the VBS script to open each of the files and loop back to this part... Not going to write the whole file for you but this should give you something to actually go on.

If you are not familier with VBS the BAT and WSF method is a little easier. See this for a reference on how to use them together. Can a Batch File Tell a program to save a file as? (If so how)