|
|
|
date: Wed, 06 Aug 2008 11:39:48 -0500,
group: microsoft.public.word.customization.menustoolbars
back
Re: Can I control a toolsbar's appearence through programming?
Thanks for the reply.
I had been working on a single file version of our letterheads that is
similar to your option #3. When that template is opened, there would
be a dialog box with radio buttons for options. Based on the options I
would move to bookmarks and insert the appropriate next. That's still
a consideration. The nice part would be that it is 1 file to upate
instead of the 27 letterhead templates I have now. I've had to shelve
that project for a while.
Since my posting, I discovered the CommandBars object and the
following code. What I need to do is figure out the value of each
combo box and use them together to determine the which template to
open when another button on the toolbar is pressed. I'm trying to see
if I can create a couple of public variables.
ie The button's action would be a routine with IFs
IF Combo1 = x and Combo2 = y then open TemplateXY
Marten
Sub AddMyCombo()
Dim comboCity As CommandBarComboBox
Set comboCity = CommandBars("Custom
1").Controls.Add(msoControlComboBox)
With comboCity
.AddItem "Toronto", 1
.AddItem "Edmonton", 2
.AddItem "Vancouver", 3
.DropDownLines = 3
.DropDownWidth = 75
.ListIndex = 0
.Tag = "City"
.OnAction = "MySub"
End With
Dim comboDiv As CommandBarComboBox
Set comboDiv = CommandBars("Custom
1").Controls.Add(msoControlComboBox)
With comboDiv
.AddItem "Retail", 1
.AddItem "Wholesale", 2
.AddItem "Internet", 3
.DropDownLines = 3
.DropDownWidth = 75
.ListIndex = 0
.Tag = "Division"
.OnAction = "MySub"
End With
End Sub
Sub MySub()
With CommandBars.ActionControl
MsgBox .Tag & " = " & .List(.ListIndex)
End With
End Sub
On Thu, 7 Aug 2008 16:13:14 +0300, "Graham Mayor"
wrote:
>You could add a custom toolbar to the template with a New Menu command added
>to it. Into that New Menu (rename it to whatever) add the autotext entries
>that represent the items that you want to include with your template. Ensure
>that the autotexts are saved in the letter template.
>
>OR
>
>You could add the templates to toolbar New Menu item, but given that you
>would have had to open a document basd on the template to get that far it
>seems rather pointless.
>
>OR
>
>You could populate the letterhead with the correct information from the
>outset using either vba or conditional includetext fields based on some
>local or user input criteria.
date: Thu, 07 Aug 2008 09:44:13 -0500
author: Marten
|
|