|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub 英文双引号转中文()
- Dim rg As Range, rgend&
- Selection.Paragraphs(1).Range.Select
- Set rg = Selection.Range
- rgend = rg.End
- Selection.Find.ClearFormatting
- Do While Selection.Find.Execute(findtext:=Chr(34), Forward:=True, MatchWildcards:=False)
- If Selection.Range.End > rgend Then Exit Do
- Selection.Range.CharacterWidth = wdWidthFullWidth
- Selection.MoveRight unit:=wdCharacter, Count:=1
- Loop
- rg.Select
- Selection.Find.ClearFormatting
- Do While Selection.Find.Execute(findtext:=Chr(-23646), Forward:=True)
- If Selection.Range.End > rgend Then Exit Do
- Selection = ChrW(8220)
- Do
- If Selection.Range.End > rgend Then Exit Do
- If Selection.Characters.Last.Text = vbCr Then GoTo Skip
- Selection.MoveEnd unit:=wdCharacter, Count:=1
- Loop Until Asc(Selection.Characters.Last) = -23646
- Selection.Characters.Last.Text = ChrW(8221)
- Skip:
- Selection.MoveRight unit:=wdCharacter, Count:=1
- Loop
- End Sub
复制代码 |
|