|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
word.zip
(714 Bytes, 下载次数: 19)
提供一个脚本。
使用方法:
打开你的文件后,双击附件中提供的脚本运行。
全文:
- Dim WordApp
- On Error Resume Next
- Set WordApp = GetObject(, "Word.Application")
- If WordApp Is Nothing Then
- MsgBox "Run Word first.", vbInformation, "Information"
- WScript.Quit
- End If
- On Error Goto 0
- Dim table
- Set table = WordApp.ActiveDocument.Tables(1)
- table.cell(3, table.columns.count).range.Select
- Const wdline = 5
- Const wdParagraph = 4
- Set sel = WordApp.selection
- Dim score, tmp, s1, s2, s3, s4, s5
- tmp = sel.text
- score = CDBL(Left(tmp, Len(tmp)-1))
- sel.movedown wdline, 2
- sel.expand wdParagraph
- sel.Font.Name = "黑体"
- sel.Font.Size = 12
- sel.ParagraphFormat.Alignment = 1
- s1 = Round(score*0.2)
- sel.typetext CStr(s1)
- sel.movedown wdline, 1
- sel.expand wdParagraph
- sel.Font.Name = "黑体"
- sel.Font.Size = 12
- sel.ParagraphFormat.Alignment = 1
- s2 = Round(score*0.3)
- sel.typetext CStr(s2)
- sel.movedown wdline, 1
- sel.expand wdParagraph
- sel.Font.Name = "黑体"
- sel.Font.Size = 12
- sel.ParagraphFormat.Alignment = 1
- s3 = Round(score*0.2)
- sel.typetext CStr(s3)
- sel.movedown wdline, 1
- sel.expand wdParagraph
- sel.Font.Name = "黑体"
- sel.Font.Size = 12
- sel.ParagraphFormat.Alignment = 1
- s4 = Round(score*0.2)
- sel.typetext CStr(s4)
- sel.movedown wdline, 1
- sel.expand wdParagraph
- sel.Font.Name = "黑体"
- sel.Font.Size = 12
- sel.ParagraphFormat.Alignment = 1
- s5 = score-s1-s2-s3-s4
- sel.typetext CStr(s5)
复制代码
|
评分
-
1
查看全部评分
-
|