Home > Software engineering >  Consult bosses! .
Consult bosses! .

Time:11-19

Want to add a signature to batch at the end of the word finally: Name, Designation, Signature& Stamp


CodePudding user response:

Write good, VBS script code is as follows:
 
Const wdcharacter=1
Const wdmove=0
The Set of word=createobject (" word. Application ")
Word. The visible=True
The Set of fso=createobject (" scripting. Filesystemobject ")
Curdir=fso. Getparentfoldername (wscript. Scriptfullname)
The Set objfolder=fso. Getfolder (curdir)
For Each objfile In objfolder. Files
The Select Case LCase (fso) getextensionname (objfile. Name))
Case "doc", "docx", "docm
"The Set of doc=word. The documents. The open (objfile. Path)
Doc. Content. Select
Word. Selection. Moveright wdcharacter, 1, wdmove
Word. The selection. The Text=VBCRLF & amp; "The Name, Designation, Signature& Stamp "
Doc. Save
Doc. Close
End the Select
Next
Word. Quit

Msgbox "done!"

Run the example:

Download address:
Link: https://pan.baidu.com/s/1GY-Cv2hGB_ru8DhGVtUoNQ
The extracted code: wt70

CodePudding user response:

reference 1st floor milaoshu1020 response:
write good, VBS script code is as follows:
 
Const wdcharacter=1
Const wdmove=0
The Set of word=createobject (" word. Application ")
Word. The visible=True
The Set of fso=createobject (" scripting. Filesystemobject ")
Curdir=fso. Getparentfoldername (wscript. Scriptfullname)
The Set objfolder=fso. Getfolder (curdir)
For Each objfile In objfolder. Files
The Select Case LCase (fso) getextensionname (objfile. Name))
Case "doc", "docx", "docm
"The Set of doc=word. The documents. The open (objfile. Path)
Doc. Content. Select
Word. Selection. Moveright wdcharacter, 1, wdmove
Word. The selection. The Text=VBCRLF & amp; "The Name, Designation, Signature& Stamp "
Doc. Save
Doc. Close
End the Select
Next
Word. Quit

Msgbox "done!"

Run the example:

Download address:
Link: https://pan.baidu.com/s/1GY-Cv2hGB_ru8DhGVtUoNQ
Extract the code: wt70
how to add a carriage return in the value field

CodePudding user response:

How to add the enter value field

Following parameters with "& amp; VBCRLF,"
  •  Tags:  
  • VBA
  • Related