
이 질문에 대한 변형을 검색했지만 이와 비슷한 것을 찾지 못했습니다.
두 가지 유형의 인라인 인용이 포함된 Word 문서 세트가 있습니다. 첫 번째는 표준 학술 인용문으로 Zotero에 삽입되었으며 그대로 유지되고 Zotero에 연결되어야 합니다.
두 번째 유형은 일반 텍스트이며 동일한 지점에서 괄호를 제거한 각주로 변환해야 합니다. 두 번째 유형의 인용은 항상 "(파일 XX_XX"로 시작합니다. 여기서 X는 정수이거나 "(디지털 파일"입니다.
이 두 번째 유형의 모든 인용을 한 번에 각주로 변환할 수 있다면 엄청난 도움이 될 것입니다. 실패하면 선택한 텍스트를 각주로 변환하고 괄호를 제거하는 매크로도 작동합니다.이제 이를 하나씩 수행하는 매크로를 기록할 수 있게 되었지만 문서 전체에서 프로세스를 자동화할 수 있는 방법이 있다면 좋을 것입니다.
도움이 되길 바라며 미리 감사드립니다.
다음은 두 가지 유형의 인용을 모두 포함하는 샘플 단락입니다.
Gauteng 지방 정부가 제도적 권한을 보유한 두 번째 영역은 대중교통 운영업체에 대한 규제였습니다. 2000년 국가 육상 운송 전환법(National Land Transport Transition Act)은 모든 대중 교통 운영자에게 노선 기반 운영 라이센스를 발급하는 일을 전담하는 지방 운영 라이센스 위원회를 설립했습니다(Cameron, 2005; Wosiyana, 2005; Palmer, Moodley 및 Parnell, 2017). 이러한 OLB는 기존 반경 기반 허가를 경로 기반 운영 면허로 전환하는 작업을 관리하고 지방자치단체의 지침에 따라 새 면허를 발급하는 일을 담당했습니다. 그러나 Rea Vaya 당시 Gauteng OLB는 "행정 혼란"에 빠져 운영 허가증 발급을 거의 중단했으며, 요하네스버그 시에서는 아직 처리되지 않은 허가 신청 영수증을 기준으로 잠재적으로 영향을 받는 운영자를 계산하게 되었습니다( 파일 03_05, 요하네스버그 시와 택시 산업 간의 참여 회의에 관한 BRT 1a단계 공동 실무 그룹, 2010년 3월 26일).
마지막 인용은 다음과 같은 각주여야 합니다.
File 03_05, 요하네스버그 시와 택시 업계 간의 참여 회의에 관한 BRT 1a단계 공동 실무 그룹, 2010년 3월 26일
답변1
이와 비슷한 것이지만, 이를 작동시키기 위해 얼마나 많은 노력을 들이고 수동으로 수정해야 하는지를 결정해야 합니다.
Sub NotesToFootnotes1()
'
Const matchcount As Integer = 2
Dim i As Integer
Dim r As Word.Range
Dim rStart As Word.Range
Dim fn As Word.Footnote
Dim s(1 To matchcount, 1 To 2) As String
' This uses a wildcard search which looks for 3 "groups"
' The first is a "("
' The second is the 'body' of the footnote
' The third is a ")"
s(1, 1) = "([(])(File [0-9][0-9]_[0-9][0-9]*)([)])"
' This replaces the found text by the content of the second group.
s(1, 2) = "\2"
s(2, 1) = "([(])(Digital file*)([)])"
s(2, 2) = "\2"
For i = 1 To matchcount
Set r = ActiveDocument.Content
With r.Find
.Text = s(i, 1)
.Replacement.Text = s(i, 2)
.Forward = True
.Wrap = wdFindStop
.Format = False
' This wil actually match Digital fIle, Digital File, DIGITAL FILE etc.
' If you only want to match Digital file, set it to False
.MatchCase = True
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
' Very important!
.MatchWildcards = True
.Execute Replace:=True
Do While .Found
Set rStart = r.Duplicate
rStart.Collapse WdCollapseDirection.wdCollapseStart
' Initially, create an empty footnote, because if we want to
' put formatted text in the footnote, we can't do it in the .Add
With rStart.Footnotes.Add(Range:=rStart, Text:="")
' Don't copy the newly inserted footnote reference!
r.Start = r.Start + 1
' This copies the content of the range, which would include formatting
' possibly images and so on. If you don't want that, use
' .Range.Text = r.Text
' instead, but be aware that anything other than text will probably not
' copy exactly the way you expect.
.Range.FormattedText = r.FormattedText
End With
Set rStart = Nothing
r.Delete
.Execute Replace:=True
Loop
Set r = Nothing
End With
Next ' i
End Sub