OrganizerCopy Method

Applies To

Application object.

Description

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. An expression that returns an Application object.

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 Long. The kind of item you want to copy. Can be one of the following WdOrganizerObject constants: wdOrganizerObjectAutoText, wdOrganizerObjectCommandBars, wdOrganizerObjectProjectItems, or wdOrganizerObjectStyles.

See Also

OrganizerDelete method, OrganizerRename method.

Example

This example copies all the AutoText entries in the template attached to the active document to the Normal template.

For Each aEntry In ActiveDocument.AttachedTemplate.AutoTextEntries
    Application.OrganizerCopy Source:=ActiveDocument.AttachedTemplate.FullName, _
        Destination:=NormalTemplate.FullName, Name:=aEntry.Name, _
        Object:=wdOrganizerObjectAutoText
Next aEntry
If the style named "SubText" exists in the active document, this example copies the style to C:\Templates\MyTemplate.dot.

For Each sty In ActiveDocument.Styles
    If sty = "SubText" Then
        Application.OrganizerCopy Source:=ActiveDocument.Name, _
            Destination:="C:\Templates\MyTemplate.dot", Name:="SubText", _
            Object:=wdOrganizerObjectStyles
    End If
Next sty