|
本帖最后由 Again123456 于 2024-5-13 19:56 编辑
- function ptf(){
- Sheets("基础信息").UsedRange.Value2.slice(1).forEach(v=>{
- let picPath = ThisWorkbook.Path + "\\照片\",
- pdfPath = ThisWorkbook.Path + "\\打印\",
- sht = Sheets("打印模板")
- sht.Range("b3:b4,d3:d4,e3,b5:e6").Value2 = null;
- ["b3","d3","b5","b4","d4","b6"].forEach((c,i) => sht.Range(c).Value2 = i == 1 ? "'" +v[i] : v[i])
- try{sht.Range("e3").RangeEx.InsertCellPicture(picPath + v[0] + ".jpg")}
- catch{}
- sht.ExportAsFixedFormat(xlTypePDF,pdfPath + v[0] + ".pdf" ,xlQualityStandard)
- Shell("cmd /c start " + pdfPath + v[0] + ".pdf",jsHide)
- })
- }
复制代码
|
|