Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a new word 2003 toolbar in VBA?

Status
Not open for further replies.

JasonEnsor

Programmer
Sep 14, 2010
193
GB
I am trying to create a template for a question paper. it has to have the following properties.
Orientation - Portrait
Margin Left & Right - 2.5cm
Margin Top & Bottom - 1.3
The numbering list needs to follow this pattern:
1.
a)
i)
The settings for those are:
1. Aligned at 0, Tab Space 1.27, Indent at 1.27
(2 Return Gap)
a) Aligned at 1.27, Tab Space, Indent at 2.54
(1 Return Gap)
i) Aligned at 2.54, Tab Space 3.81, Indent at 3.81
(1 Return Gap)

I then need to have 'Turn Over' Right Justified on the second to last line on the page and the page number on the last line on the page. However we are unable to use this as a header and footer.

All text must be restricted to Arial Size 14.

Anyone have any suggestions on how to best do this? I have tried using a template however i am not able to restrict it enough?

I had thought about creating a toolbar that had the main buttons i needed on it such as the numbering styles but not sure how to achieve this.

Any help would be appreciated.
 
however i am not able to restrict it enough?"

Restrict it in what way?


unknown
 
I am not able to restrict them from altering the font used, and from changing the numbering system. Originally i set up a template for others to follow however they then change font, size, margins....basically everything they can, which means that i then spend countless hours trying to rectify this as we have strict rules that must be followed.

I may not be explaining myself very well, i have spent weeks working on this and feel like i am getting nowhere i have attached the original word document that i distribute as a template to get filled in. However as i said it doesnt have anyway of enforcing the rules that we have set about font size, numbering styles ect...I am happy to complete the front page as a seperate document, it's the rest that is a pain.

I hope some 1 can help.

Regards

Jason
 
 http://www.mediafire.com/?apubt21ku50226y
I can not access that.

" doesnt have anyway of enforcing the rules "

That may be impossible. It definitely IS impossible for anyone who is knowledgeable about Word.

If I understand correctly, you have a specific format structure you want to "enforce". Yes?

1. are these done as Styles? If not, forget your goal.

2. Yes, you can make a toolbar. This is what I do for template I try to restrict. I put all (most) of the approved styles on the toolbar, and then REMOVE all formatting tools. So I remove the Format menu, I disable shortcuts, remove alignment icons etc. etc.

Essentially the UI (toolbars) contains my styles and save buttons.

Does this help to "restrict" things to the formats (using styles) I want them to use? Yes, to a degree. Does it completely prevent anyone from screwing it up...not a chance.


unknown
 
The people that will be filling in the template can barely open word, so the chance of them being too knowledgable is very slim. i am just looking for the best way of forcing them to only use Arial size 14, To use a designated number format and for the margins to be set automatically. i thought if i had a custom toolbar then i could remove the other options that they wouldnt need.

I would like to use styles but again i am not sure as the best way of setting these up.

How would i use vba to create the new toolbar for the template?
 
I would not use VBA, nor do you need to.

This is a classic case of using templates.

1. YOU make the template (the .dot file).

2. YOU set the margins in the .dot file. Any document cloned from the template will have those margins.

3. If you want a new toolbar..you do not need VBA. Tools > Customize and click on th etoolbars tab. Click New. Give it a name and a save location. Voila. ther eis your new toolbar. You can put whatever you want on it.

"i am just looking for the best way of forcing them to only use Arial size 14,"

You can't. Are you saying you ONLY want Arial 14pts for ALL text in the document? Ever?


unknown
 
I am definatly saying i only want them to use arial 14 throughout the whole document forever. That is the standard that we have been set so thats what we need to use.

Ideally i should be able to tell people only use arial 14.....but let's face it we all know that people would still do what they wanted.

I appreciate all your help so far :)
 
Then why not on document Save simple programmatically make all text Arial 14? You can do this with an overwrite of FileSave.
Code:
Sub FileSave()
With ActiveDocument
   With .Range
     .Font.Size = 14
     .Font.Name = "Arial"
   End With
   .Save
End With
End Sub
Now when the file is saved - every time - all text becomes Arial 14.


unknown
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top