Copying Toolbars in VBA

User avatar
Don Wells
5StarLounger
Posts: 689
Joined: 27 Jan 2010, 16:45
Location: Ottawa, Ontario, Canada

Copying Toolbars in VBA

Post by Don Wells »

My user is moving from Office 2003 to 2007

The following code works well in 2003 but command 1025 fails in 2007
Can anyone offer insight into the cause?

T.I.A.

Code: Select all

Private Sub Add_Macros()
    
1015    Application.OrganizerCopy _
            Source:="C:\My Documents\tools\Compliance_Matrix_source.dot", _
            Destination:=Target, _
            Name:="RepairComplianceMatrix", _
            Object:=wdOrganizerObjectProjectItems
1025    Application.OrganizerCopy _
            Source:="C:\My Documents\tools\Compliance_Matrix_source.dot", _
            Destination:=Target, _
            Name:="Matrix Repair", _
            Object:=wdOrganizerObjectCommandBars
End Sub
Regards
Don

User avatar
HansV
Administrator
Posts: 78229
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Copying Toolbars in VBA

Post by HansV »

In what sense doesn't it work? Do you get an error message and if so what does it say?

What is Target?
Best wishes,
Hans

User avatar
Don Wells
5StarLounger
Posts: 689
Joined: 27 Jan 2010, 16:45
Location: Ottawa, Ontario, Canada

Re: Copying Toolbars in VBA

Post by Don Wells »

HansV wrote:In what sense doesn't it work? Do you get an error message and if so what does it say?

What is Target?
Hi Hans

Thanks for the response, my problem turned out to be a corrupted/revised source file. The command bar was missing.

At times it pays to sleep on a problem. :doh:
Regards
Don