PDA

View Full Version : Solved: How to copy styles from an Addin



fionabolt
11-26-2009, 07:37 AM
Hi there,

I'm trying to copy styles from a .dot Addin to an open document. However the following code falls over at the Application.OrganizerCopy line with the err 4149, File not Found.

Anyone out there got a better solution for copying styles from an Addin?

Thanks
Fiona

Sub blah()
Dim ad As AddIn
Dim addinTmp As String
For Each ad In AddIns
If ad.Name = ADDINNAME Then
addinTmp = ad.Path & Application.PathSeparator & ad.Name
End If
Next ad
Application.OrganizerCopy addinTmp, ActiveDocument, "Body Text", wdOrganizerObjectStyles
End Sub

fionabolt
11-26-2009, 10:00 AM
Silly me: I need to put ActiveDocument.FullName and then it works great :banghead: