Hi Folks,
I have a series of templates and wizards that I wish to be able to
re-create with options on a userform. Ideally I'd like to be able to
create styles and toolbars programatically but I'm told this can't be
done (if it can be please let me know :-) ).

So what I'd like to do is write some code which can find my templates
and copy the styles, toolbars and modules/userforms to a new version of
the template. I think the organiser can be accessed using VBA but I'm
not sure about importing modules and forms.

Can anyone provide a sample of using the organiser and, if it can be
done, code to import modules and forms.

Any pointers appreciated.

J

Re: How to use the organiser programatically by Jonathan

Jonathan
Tue Aug 03 07:25:24 CDT 2004

Hi JB,

You need to use the OrganizerCopy method. Provided that ther code is not in
a protected project, you can use the OrganizerCopy method to copy userforms
and modules between templates.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


"JB" <no@way.com> wrote in message
news:uhDUE1UeEHA.1048@tk2msftngp13.phx.gbl...
> Hi Folks,
> I have a series of templates and wizards that I wish to be able to
> re-create with options on a userform. Ideally I'd like to be able to
> create styles and toolbars programatically but I'm told this can't be
> done (if it can be please let me know :-) ).
>
> So what I'd like to do is write some code which can find my templates
> and copy the styles, toolbars and modules/userforms to a new version of
> the template. I think the organiser can be accessed using VBA but I'm
> not sure about importing modules and forms.
>
> Can anyone provide a sample of using the organiser and, if it can be
> done, code to import modules and forms.
>
> Any pointers appreciated.
>
> J


Re: How to use the organiser programatically by Chad

Chad
Tue Aug 03 16:32:05 CDT 2004

JB,

Jonathan supplied the method by which you can use the organiser
programmatically. However, I'd like to add that contrary to what you've
been told, you CAN create styles and toolbars programmatically.

FWIW
Chad


"JB" <no@way.com> wrote in message
news:uhDUE1UeEHA.1048@tk2msftngp13.phx.gbl...
> Hi Folks,
> I have a series of templates and wizards that I wish to be able to
> re-create with options on a userform. Ideally I'd like to be able to
> create styles and toolbars programatically but I'm told this can't be
> done (if it can be please let me know :-) ).
>
> So what I'd like to do is write some code which can find my templates
> and copy the styles, toolbars and modules/userforms to a new version of
> the template. I think the organiser can be accessed using VBA but I'm
> not sure about importing modules and forms.
>
> Can anyone provide a sample of using the organiser and, if it can be
> done, code to import modules and forms.
>
> Any pointers appreciated.
>
> J



Re: How to use the organiser programatically by JB

JB
Wed Aug 04 05:04:46 CDT 2004

Chad DeMeyer wrote:
> JB,
>
> Jonathan supplied the method by which you can use the organiser
> programmatically. However, I'd like to add that contrary to what you've
> been told, you CAN create styles and toolbars programmatically.
>
> FWIW
> Chad
>
>
> "JB" <no@way.com> wrote in message
> news:uhDUE1UeEHA.1048@tk2msftngp13.phx.gbl...
>
>>Hi Folks,
>>I have a series of templates and wizards that I wish to be able to
>>re-create with options on a userform. Ideally I'd like to be able to
>>create styles and toolbars programatically but I'm told this can't be
>>done (if it can be please let me know :-) ).
>>
>>So what I'd like to do is write some code which can find my templates
>>and copy the styles, toolbars and modules/userforms to a new version of
>>the template. I think the organiser can be accessed using VBA but I'm
>>not sure about importing modules and forms.
>>
>>Can anyone provide a sample of using the organiser and, if it can be
>>done, code to import modules and forms.
>>
>>Any pointers appreciated.
>>
>>J
>
>
>
Ahh, any chance you could supply a sample Chad?

J

Re: How to use the organiser programatically by Chad

Chad
Wed Aug 04 11:28:54 CDT 2004

To add a style:

Set oStyle = ActiveDocument.Styles.Add(Name:="Cool New Style",
Type:=wdStyleTypeParagraph)
With oStyle
With .Font
'font settings
End With
With .ParagraphFormat
'paragraph format settings
End With
'etc.
End With

To add a toolbar:

CustomizationContext = 'set this to a template or document object that
represents the template or document you want to save the toolbar with, or
use the constant NormalTemplate if you want to save it in Normal.dot

Set oCmdBar = CommandBars.Add(Name:="Custom", Position:=msoBarFloating,
Temporary:=True)
'Temporary argument above is optional, default is False, if set to True the
command bar is deleted when the container application is closed
With oCmdBar
.Controls.Add Type:=msoControlButton,
Id:=CommandBars("Edit").Controls("Paste").ID
'etc.
.Visible = True
End With

Hope that helps
Regards,
Chad


"JB" <no@way.com> wrote in message
news:OlI95pgeEHA.4092@TK2MSFTNGP10.phx.gbl...
> Chad DeMeyer wrote:
> > JB,
> >
> > Jonathan supplied the method by which you can use the organiser
> > programmatically. However, I'd like to add that contrary to what you've
> > been told, you CAN create styles and toolbars programmatically.
> >
> > FWIW
> > Chad
> >
> >
> > "JB" <no@way.com> wrote in message
> > news:uhDUE1UeEHA.1048@tk2msftngp13.phx.gbl...
> >
> >>Hi Folks,
> >>I have a series of templates and wizards that I wish to be able to
> >>re-create with options on a userform. Ideally I'd like to be able to
> >>create styles and toolbars programatically but I'm told this can't be
> >>done (if it can be please let me know :-) ).
> >>
> >>So what I'd like to do is write some code which can find my templates
> >>and copy the styles, toolbars and modules/userforms to a new version of
> >>the template. I think the organiser can be accessed using VBA but I'm
> >>not sure about importing modules and forms.
> >>
> >>Can anyone provide a sample of using the organiser and, if it can be
> >>done, code to import modules and forms.
> >>
> >>Any pointers appreciated.
> >>
> >>J
> >
> >
> >
> Ahh, any chance you could supply a sample Chad?
>
> J



Re: How to use the organiser programatically by JB

JB
Thu Aug 05 03:59:42 CDT 2004

Chad DeMeyer wrote:
> To add a style:
>
> Set oStyle = ActiveDocument.Styles.Add(Name:="Cool New Style",
> Type:=wdStyleTypeParagraph)
> With oStyle
> With .Font
> 'font settings
> End With
> With .ParagraphFormat
> 'paragraph format settings
> End With
> 'etc.
> End With
>
> To add a toolbar:
>
> CustomizationContext = 'set this to a template or document object that
> represents the template or document you want to save the toolbar with, or
> use the constant NormalTemplate if you want to save it in Normal.dot
>
> Set oCmdBar = CommandBars.Add(Name:="Custom", Position:=msoBarFloating,
> Temporary:=True)
> 'Temporary argument above is optional, default is False, if set to True the
> command bar is deleted when the container application is closed
> With oCmdBar
> .Controls.Add Type:=msoControlButton,
> Id:=CommandBars("Edit").Controls("Paste").ID
> 'etc.
> .Visible = True
> End With
>
> Hope that helps
> Regards,
> Chad
>
>
> "JB" <no@way.com> wrote in message
> news:OlI95pgeEHA.4092@TK2MSFTNGP10.phx.gbl...
>
>>Chad DeMeyer wrote:
>>
>>>JB,
>>>
>>>Jonathan supplied the method by which you can use the organiser
>>>programmatically. However, I'd like to add that contrary to what you've
>>>been told, you CAN create styles and toolbars programmatically.
>>>
>>>FWIW
>>>Chad
>>>
>>>
>>>"JB" <no@way.com> wrote in message
>>>news:uhDUE1UeEHA.1048@tk2msftngp13.phx.gbl...
>>>
>>>
>>>>Hi Folks,
>>>>I have a series of templates and wizards that I wish to be able to
>>>>re-create with options on a userform. Ideally I'd like to be able to
>>>>create styles and toolbars programatically but I'm told this can't be
>>>>done (if it can be please let me know :-) ).
>>>>
>>>>So what I'd like to do is write some code which can find my templates
>>>>and copy the styles, toolbars and modules/userforms to a new version of
>>>>the template. I think the organiser can be accessed using VBA but I'm
>>>>not sure about importing modules and forms.
>>>>
>>>>Can anyone provide a sample of using the organiser and, if it can be
>>>>done, code to import modules and forms.
>>>>
>>>>Any pointers appreciated.
>>>>
>>>>J
>>>
>>>
>>>
>>Ahh, any chance you could supply a sample Chad?
>>
>>J
>
>
>
Thanks for your help folks, Both suggestions will be used!

Cheers

J