仅在脚注中替换脚注参考的上标 [英] Replace superscript of Footnote reference in the footnotes only

查看:204
本文介绍了仅在脚注中替换脚注参考的上标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将脚注转换为特定的字体样式(芝加哥样式).我设法单独更改了脚注的字体,但是我无法在页面的脚注中引用脚注参考编号.我正在尝试将上标转换为正常数字,并且由于某种原因而无法使代码正常工作.它会不断更改文档其余部分中的上标,这不是我要查找的内容,因为正文中的参考号保持上标.任何帮助,将不胜感激.谢谢!

I am trying to convert the footnotes into a specific font style (Chicago Style). I have managed to change font of footnotes separately but I can't refer to the footnote reference number in the footnotes of the pages. I am trying to convert the superscript into a normal number and can't get the code to work for some reason. It keeps changing the superscripts in the rest of the body of the document which is not what I am looking for because reference number in body are kept superscripted. Any help would be appreciated. Thank you!

   With ActiveDocument.Styles("Normal").Font
        .Name = "Palatino Linotype"
        .Size = 11
    End With
    
    Dim afn As Footnote
    For Each afn In ActiveDocument.Footnotes
        With afn.Range
            .Font.Size = 8.5
            .Font.Name = "Palatino Linotype"
            .Text = .Text
        End With
    Next afn
    
    Dim f As Footnote

    For Each f In ActiveDocument.Footnotes
      With f.Range.Characters(1)
        .Font.Superscript = False
      End With
    Next
        
    'With Selection
       '.Paragraphs(1).Range.Font.Reset
       '.Paragraphs(1).Range.Characters(2) = ""
       '.InsertAfter "." & vbTab
       '.Collapse wdCollapseEnd
    'End With
        
    
    'For Each afn In ActiveDocument.Footnotes
        'With ActiveDocument.Content.Find
         '.ClearFormatting
         '.Replacement.ClearFormatting
         '.Font.Superscript = True
         '.Format = True
         '.Text = ""
         '.Replacement.Text = "^&"
         '.Replacement.Font.Superscript = False
         '.MatchWildcards = True
         '.Execute Replace:=wdReplaceAll
        'End With
    'Next afn
    
    
    'Make Footnotes non-superscripted
    'With ActiveDocument.Content.Find
        '.ClearFormatting
        '.Replacement.ClearFormatting
        '.Font.Superscript = True
        '.Format = True
        '.Text = ""
        '.Replacement.Text = "^&"
       ' .Replacement.Font.Superscript = False
      '  .MatchWildcards = True
     '   .Execute

推荐答案

Word文档是由许多故事范围"构成的,其中一个就是脚注故事".要使脚注编号仅在脚注中不上标,您可以执行查找并替换脚注故事,如下所示.

A Word document is constructed from a number of Story Ranges, one of which is the Footnotes Story. To make the footnote number non-superscript just in the footnotes you can execute a find and replace in the Footnotes Story as below.

Sub ApplyChicagoStyle()
   With ActiveDocument.StoryRanges(wdFootnotesStory).Find
      .Style = ActiveDocument.Styles(wdStyleFootnoteReference)
      .Replacement.Style = ActiveDocument.Styles(wdStyleFootnoteText)
      .Replacement.Font.Superscript = False
      .Format = True
      .Execute Replace:=wdReplaceAll
   End With
End Sub

在将所有脚注添加到文档中之后,需要运行此操作.

You would need to run this after you have added all the footnotes to your document.

这篇关于仅在脚注中替换脚注参考的上标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆