Application.OrganizerCopy method (Word)
Copies the specified AutoText entry, toolbar, style, or macro project item from the source document or template to the destination document or template.
Syntax
expression. OrganizerCopy
( _Source_
, _Destination_
, _Name_
, _Object_
)
expression Required. A variable that represents an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Source | Required | String | The document or template file name that contains the item you want to copy. |
Destination | Required | String | The document or template file name to which you want to copy an item. |
Name | Required | String | The name of the AutoText entry, toolbar, style, or macro you want to copy. |
Object | Required | WdOrganizerObject | The kind of item you want to copy. |
Example
This example copies all the AutoText entries in the template attached to the active document to the Normal template.
Dim atEntry As AutoTextEntry
For Each atEntry In _
ActiveDocument.AttachedTemplate.AutoTextEntries
Application.OrganizerCopy _
Source:=ActiveDocument.AttachedTemplate.FullName, _
Destination:=NormalTemplate.FullName, Name:=atEntry.Name, _
Object:=wdOrganizerObjectAutoText
Next atEntry
If the style named "SubText" exists in the active document, this example copies the style to C:\Templates\Template1.dot.
Dim styleLoop As Style
For Each styleLoop In ActiveDocument.Styles
If styleLoop = "SubText" Then
Application.OrganizerCopy Source:=ActiveDocument.Name, _
Destination:="C:\Templates\Template1.dot", _
Name:="SubText", _
Object:=wdOrganizerObjectStyles
End If
Next styleLoop
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기