Word 2013 中的引号问题
Quotation Mark Problems In Word 2013
你好朋友我对引号有疑问,所以我的问题是:
我有一个 word 文档(大约 100 页),想用(查找和替换)更改引号,但 word 无法理解我需要什么。这是我的示例....
"Test Word" 你看到引号我想用“测试词”来改变它们(这是格鲁吉亚语中使用的引号)。你能帮助解决这个问题吗...(我也尝试使用像 ^0132) 这样的代码,但结果是一样的。
谢谢你在高级!
很简单,打开文档和运行下面的宏:
Sub TestFormatQuotes()
Selection.WholeStory
Selection.LanguageID = wdGeorgian
Selection.Range.AutoFormat
End Sub
这将 select 整个文档,将语言设置为格鲁吉亚语,并通过 运行 自动套用格式将引号自动替换为左下角和右上角的引号。
您可以手动执行此操作,方法是使用“文件”-“选项”-“快速访问工具栏”将“自动套用格式”按钮添加到快速访问工具栏,然后在左侧列表中 select "Commands not in the Ribbon"。如果您的自动套用格式设置正确(检查自动套用格式对话框中的选项,自动套用格式选项卡,替换,启用 "Straight Quotes" 到 "Smart Quotes" 选项)这将自动替换所有直引号。
这是一个示例,其中包含在使用自动格式替换之前完全恢复直引号的选项。我在上面的问题文本中对此进行了测试并与我一起工作。
Sub testquotes()
Selection.WholeStory
Dim ReplaceQuotes As Boolean
ReplaceQuotes = Application.Options.AutoFormatReplaceQuotes = False
Dim ReplaceQuotesAsYouType As Boolean
ReplaceQuotesAsYouType = Application.Options.AutoFormatAsYouTypeReplaceQuotes = False
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
' Alt-0132
With Selection.Find
.Text = "„"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
' Alt-0147
With Selection.Find
.Text = "”"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
' Alt-0148
With Selection.Find
.Text = "“"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'---Comment This part to revert to straight quotes
Application.Options.AutoFormatReplaceQuotes = True
Application.Options.AutoFormatAsYouTypeReplaceQuotes = True
Selection.LanguageID = wdGeorgian
Selection.Range.AutoFormat
'---Comment This part to revert to straight quotes
Application.Options.AutoFormatReplaceQuotes = ReplaceQuotes
Application.Options.AutoFormatAsYouTypeReplaceQuotes = ReplaceQuotesAsYouType
End Sub
你好朋友我对引号有疑问,所以我的问题是:
我有一个 word 文档(大约 100 页),想用(查找和替换)更改引号,但 word 无法理解我需要什么。这是我的示例....
"Test Word" 你看到引号我想用“测试词”来改变它们(这是格鲁吉亚语中使用的引号)。你能帮助解决这个问题吗...(我也尝试使用像 ^0132) 这样的代码,但结果是一样的。
谢谢你在高级!
很简单,打开文档和运行下面的宏:
Sub TestFormatQuotes()
Selection.WholeStory
Selection.LanguageID = wdGeorgian
Selection.Range.AutoFormat
End Sub
这将 select 整个文档,将语言设置为格鲁吉亚语,并通过 运行 自动套用格式将引号自动替换为左下角和右上角的引号。
您可以手动执行此操作,方法是使用“文件”-“选项”-“快速访问工具栏”将“自动套用格式”按钮添加到快速访问工具栏,然后在左侧列表中 select "Commands not in the Ribbon"。如果您的自动套用格式设置正确(检查自动套用格式对话框中的选项,自动套用格式选项卡,替换,启用 "Straight Quotes" 到 "Smart Quotes" 选项)这将自动替换所有直引号。
这是一个示例,其中包含在使用自动格式替换之前完全恢复直引号的选项。我在上面的问题文本中对此进行了测试并与我一起工作。
Sub testquotes()
Selection.WholeStory
Dim ReplaceQuotes As Boolean
ReplaceQuotes = Application.Options.AutoFormatReplaceQuotes = False
Dim ReplaceQuotesAsYouType As Boolean
ReplaceQuotesAsYouType = Application.Options.AutoFormatAsYouTypeReplaceQuotes = False
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
' Alt-0132
With Selection.Find
.Text = "„"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
' Alt-0147
With Selection.Find
.Text = "”"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
' Alt-0148
With Selection.Find
.Text = "“"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'---Comment This part to revert to straight quotes
Application.Options.AutoFormatReplaceQuotes = True
Application.Options.AutoFormatAsYouTypeReplaceQuotes = True
Selection.LanguageID = wdGeorgian
Selection.Range.AutoFormat
'---Comment This part to revert to straight quotes
Application.Options.AutoFormatReplaceQuotes = ReplaceQuotes
Application.Options.AutoFormatAsYouTypeReplaceQuotes = ReplaceQuotesAsYouType
End Sub