ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 8562|回复: 22

[求助]英文试题排版(困扰我两年了)

[复制链接]

TA的精华主题

TA的得分主题

发表于 2008-4-12 00:59 | 显示全部楼层 |阅读模式

各位大虾,请帮忙看看这种英文试题,怎么用WORD排版啊!!!

 

mJQSkjIH.rar (192.69 KB, 下载次数: 34)

TA的精华主题

TA的得分主题

发表于 2008-4-12 06:24 | 显示全部楼层

最好是将文件用doc文档格式上传,而非pdf格式。

另外请楼主最好说清需要达到的具体要求,而非一句话带过,让大家猜题。

TA的精华主题

TA的得分主题

发表于 2008-4-12 07:40 | 显示全部楼层

很容易实现啊.就按正常编辑.上面的加下划线,下划线下面的大写字母单独输一行移到相应位置就可以了.最后再调整一下行间距. 如果用文本框的话,太麻烦了.

TA的精华主题

TA的得分主题

 楼主| 发表于 2008-4-12 09:43 | 显示全部楼层
QUOTE:
以下是引用istudyexcel在2008-4-12 7:40:58的发言:

很容易实现啊.就按正常编辑.上面的加下划线,下划线下面的大写字母单独输一行移到相应位置就可以了.最后再调整一下行间距. 如果用文本框的话,太麻烦了.

我以前一直是用这样的方法,

但要调整在下划线下单词的位置,敲那么多Tap,空格总觉得太累,有时感觉还是不在正中间

特别是在一篇短文中增加,减少一两个单词时要全部调整,挺麻烦的

大虾们有无更好的方法

TA的精华主题

TA的得分主题

发表于 2008-4-12 14:46 | 显示全部楼层

可试试如下程序:

Sub Marking()
'运行本程序前请先对需编号标记的内容加下划线
Dim oRange As Range, myPar As Paragraph, myRange As Range, oh As Single, n As Byte
Dim pl As Long, pt As Long, pw As Long, ph As Long, w As Single, h As Single, myShape As Shape
Application.ScreenUpdating = False
'如果没有选定区域则进行全文档处理
Set oRange = IIf(Selection.Type = wdSelectionIP, ActiveDocument.Content, Selection.Range)
'编号规则暂定为段落不同重新编号
For Each myPar In oRange.Paragraphs
    Set myRange = myPar.Range
    oh = myRange.Characters(1).Information(wdVerticalPositionRelativeToTextBoundary)
    With myRange.Find
        .ClearFormatting
        .Format = True
        .Font.Underline = wdUnderlineSingle
        Do While .Execute
            n = n + 1
            With myRange
                .Font.Underline = wdUnderlineNone
                .Fields.Add myRange, wdFieldEmpty, "eq \o(\x\bo(" & .Text & "))", False
                .MoveEnd
                .Fields(1).Code.Text = RTrim(.Fields(1).Code.Text)
                .Select
                ActiveWindow.GetPoint pl, pt, pw, ph, Selection.Range
                pl = PixelsToPoints(pl)
                pt = PixelsToPoints(pt)
                pw = PixelsToPoints(pw)
                ph = PixelsToPoints(ph)
                w = Selection.Information(wdHorizontalPositionRelativeToTextBoundary)
                h = Selection.Information(wdVerticalPositionRelativeToTextBoundary)
                Set myShape = Me.Shapes.AddTextbox(msoTextOrientationHorizontal, w, h - oh + .Font.Size + 2, pw, ph, myPar.Range)
                With myShape
                    .Select
                    .Height = .Height - .TextFrame.MarginTop - .TextFrame.MarginBottom
                    .Width = .Width - .TextFrame.MarginLeft - .TextFrame.MarginRight
                    .TextFrame.MarginTop = 0
                    .TextFrame.MarginBottom = 0
                    .TextFrame.MarginLeft = 0
                    .TextFrame.MarginRight = 0
                    .Line.Visible = msoFalse
                    .Fill.Visible = msoFalse
                    Selection.HomeKey
                    Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
                    Fields.Add Selection.Range, wdFieldEmpty, "=" & n & " \*ALPHABETIC", False
                End With
                .SetRange .End, myPar.Range.End
            End With
        Loop
    End With
    n = 0
Next
Application.ScreenUpdating = True
End Sub

[此贴子已经被作者于2008-4-12 14:49:12编辑过]

TA的精华主题

TA的得分主题

发表于 2008-4-14 17:41 | 显示全部楼层
<p>换另一种方法处理:不用EQ域,保留下划线,复原时只需清除文本框。<br/><br/>Sub oMarking2()<br/>'运行本程序前请先对需编号标记的内容加下划线<br/>Dim myzm As Integer, oRange As Range, myPar As Paragraph, myRange As Range, oh As Single, n As Integer, TF As Boolean<br/>Dim pl As Long, pt As Long, pw As Long, ph As Long, w As Single, h As Single, myShape As Shape<br/>On Error GoTo hd<br/>Application.ScreenUpdating = False<br/>ActiveDocument.ActiveWindow.View.ShowFieldCodes = False<br/>myzm = ActiveWindow.ActivePane.View.Zoom<br/>ActiveWindow.ActivePane.View.Zoom = 100<br/>'如果没有选定区域则进行全文档处理<br/>Set oRange = IIf(Selection.Type = wdSelectionIP, ActiveDocument.Content, Selection.Range)<br/>'编号规则暂定为段落不同重新编号<br/>For Each myPar In oRange.Paragraphs<br/>&nbsp;&nbsp;&nbsp; Set myRange = myPar.Range<br/>&nbsp;&nbsp;&nbsp; oh = myRange.Characters(1).Information(wdVerticalPositionRelativeToTextBoundary)<br/>&nbsp;&nbsp;&nbsp; With myRange.Find<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .ClearFormatting<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Format = True<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Font.Underline = wdUnderlineSingle<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Do While .Execute<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n = n + 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With myRange<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Select<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '判断当前选定位置与所在段落首字符是否同页<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If .Characters(1).Information(wdActiveEndPageNumber) &lt;&gt; myPar.Range.Characters(1).Information(wdActiveEndPageNumber) _<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Then TF = True<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ActiveWindow.GetPoint pl, pt, pw, ph, Selection.Range<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pw = PixelsToPoints(pw)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ph = PixelsToPoints(ph)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; w = Selection.Information(wdHorizontalPositionRelativeToTextBoundary)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h = Selection.Information(wdVerticalPositionRelativeToTextBoundary)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set myShape = ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, w, _<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IIf(TF, h, h - oh) + .Font.Size, pw, ph, IIf(TF, myRange, myPar.Range))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With myShape<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.MarginTop = 0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.MarginBottom = 0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.MarginLeft = 0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.MarginRight = 0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Line.Visible = msoFalse<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Fill.Visible = msoFalse<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fields.Add .TextFrame.TextRange, wdFieldEmpty, "=" & n & " \*ALPHABETIC", False<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.TextRange.Font.Size = myRange.Font.Size<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.TextRange.ParagraphFormat.Alignment = wdAlignParagraphCenter<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.TextRange.ParagraphFormat.LineSpacingRule = myRange.ParagraphFormat.LineSpacingRule<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .TextFrame.TextRange.ParagraphFormat.LineSpacing = myRange.ParagraphFormat.LineSpacing<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '同一项下划线内容如出现换行,编号标记在第一行<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Selection.Characters.First.Information(wdVerticalPositionRelativeToTextBoundary) _<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&gt; Selection.Characters.Last.Information(wdVerticalPositionRelativeToTextBoundary) Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Height = .Height / 2 '假设同一项内容不超过两行<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Width = ActiveDocument.PageSetup.PageWidth - ActiveDocument.PageSetup.LeftMargin _<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - ActiveDocument.PageSetup.RightMargin - ActiveDocument.PageSetup.Gutter - w<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .SetRange .End, myPar.Range.End<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TF = False<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Loop<br/>&nbsp;&nbsp;&nbsp; End With<br/>&nbsp;&nbsp;&nbsp; n = 0<br/>Next<br/>ActiveDocument.ActiveWindow.ActivePane.View.Zoom = myzm<br/>oRange.Select<br/>Application.ScreenUpdating = True<br/>Exit Sub<br/>hd: MsgBox "程序出现意外,终止运行!"<br/>End Sub</p><p>补充修改:加了两句,试图适应对段落行间距的特殊设置,但还不适应段前段后间距的特殊设置。测试文档如下:</p> 19cvJtCb.rar (21.43 KB, 下载次数: 20) <br/>
[此贴子已经被作者于2008-6-13 1:22:47编辑过]


对附件中代码的更新: 在下划线下标记选项.rar (24.01 KB, 下载次数: 15)

[ 本帖最后由 sylun 于 2009-4-26 08:52 编辑 ]

TA的精华主题

TA的得分主题

发表于 2008-4-21 17:15 | 显示全部楼层

是这样的效果吗?

mhug5XfQ.rar (76.08 KB, 下载次数: 22)


[此贴子已经被作者于2008-4-21 17:18:26编辑过]

9HsgJkh0.rar

4.1 KB, 下载次数: 12

[求助]英文试题排版(困扰我两年了)

TA的精华主题

TA的得分主题

 楼主| 发表于 2008-4-21 22:45 | 显示全部楼层

非常感谢各位大虾的解答,学习了

这几天外出了.没及时回复,请大虾们谅解!

TA的精华主题

TA的得分主题

发表于 2008-4-22 16:52 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助

象5楼的那样,用eq域

TA的精华主题

TA的得分主题

发表于 2008-6-13 01:40 | 显示全部楼层

请教sylun兄,代码能放在normal的NewMacros里吗?我放进去,运行代码,弹出"程序出现意外,终止运行!",请sylun兄帮忙.

如果放在ThisDocument里,则可行,但有个问题,如果在替换后对文档的字号重新设置,改错题的选项A、B、C、D等字号不会随之变化(还是不变)

[此贴子已经被作者于2008-6-13 1:48:50编辑过]
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-11-27 13:39 , Processed in 0.059410 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表