2014-07-01 2 views

답변

0

가장 쉬운 방법은 Word VBA를 사용하는 것입니다.

스타일을 할당 할 200 개의 Word 파일을 다른 파일이없는 디렉토리에 배치하십시오. 그런 다음 .dotm (Word 2007 이상) 또는 .dot (Word 2003 이하) 템플릿 파일을 다른 위치에 만듭니다. 템플릿 파일에 복사 할 스타일을 만들고도 (편집기에 액세스하려면 Alt-F11) 같은 템플릿 파일 내에서 모듈에 다음 코드를 넣습니다

Sub BatchCopyStyles() 

'Make sure that the template that contains the style to be copied and this code 
'is open and acting as the active document before running this macro 

Dim file As Variant 
Dim folderPath As String 'path to files receiving the style 
Dim targetPath As String 
Dim templateFile As String 'file that contains style and this code 
Dim styleTemplate As Document 

folderPath = "C:\Users\Joe\Desktop\TargetFolder\" 
templateFile = "C:\Users\Joe\Desktop\CopyStyle.dotm" 

Set styleTemplate = ActiveDocument 
file = Dir(folderPath) 

    While (file <> "") 
     Set file = Documents.Open(FileName:=folderPath & file) 
     styleTemplate.Activate 
     targetPath = folderPath & file 
     Application.OrganizerCopy Source:=templateFile, _ 
        Destination:=targetPath, _ 
        Name:="StyleToCopy", _ 
        Object:=wdOrganizerObjectStyles 
     file.Close wdSaveChanges 
     file = Dir 
    Wend 
End Sub 

편집 올바른 경로에 대한 코드를 파일 이름, 스타일 이름 등.이 코드와 활성 문서로 지정할 스타일이 포함 된 파일로 VBA 편집기 (F5)에서 매크로를 실행하십시오. 그러면 각 파일이 열리고 스타일이 복사 된 다음 파일이 닫힙니다. 문서를 200 번 열고 닫는 것은 그리 좋지는 않지만 일을해야합니다.

관련 문제