Word - Styles & Formatting task pane

B

Baret

I am creating a word template and I want the styles & formatting palette to
come up automatically when the document is opened.

I have tried various things; switching on 'Show task pane' in the options,
installing the Show Task Pane add in and putting the script
'Application.TaskPanes(wdTaskPaneFormatting).Visible = True' in the script
editor.

Show Task Pane doesnt work, the add in option means I will have to ensure
all users have the add in installed which is not possible and the script
worked on one occassion but I cannot get it to work again (I keep pasting the
script into the this document script editor and saving and each time I open
it doesnt work and when I go to the editor the script I pasted isnt there).
However, it only worked in the sense that when I opened the document I had
to select show task pane and it automatically went to styles and formatting -
it didnt automatically show up on opening the document.

I am using Office 2003 on Windows XP.

Any help would be appreciated - a script embeded into the template that
automatically shows the task pane and automatically shows the styles and
formatting palette would be great!

Many thanks

Baret
 
G

Graham Mayor

The ShowTaskPane add-in controls the startup task pane. Whether or not you
have the startup taskpane displayed

Sub AutoOpen()
Application.TaskPanes(wdTaskPaneFormatting).Visible = True
End Sub
Sub AutoNew()
Application.TaskPanes(wdTaskPaneFormatting).Visible = True
End Sub

saved in the template works for me.
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Baret

Hi Graham
Many thanks for your quick reply.
I followed the instructions on your website link. Opened the template, went
to Macros, create new, paste in AutoOpen etc and then same again for AutoNew.
I then saved the template.

When I open it up now I get a message saying macros for this document are
disabled? If I click ok the template opens and the TaskPane is visible (but
not on the styles and formatting palette).

Am I doing something wrong?

Thanks

Baret
 
G

Graham Mayor

Where exactly did you save the macros? They should have been saved in the
document template - not in the document, nor in the normal template.

Open the document template in Word, then open the vba editor. The Template
Project relating to your template will be at the bottom of the Project
Explorer window (CTRL+R - if not displayed).

When you create a new document from that template the task pane will open.
When you later open that document again the task pane will open - provided
the template is still in the user templates folder. There should be no
macros in the document to trigger the warning associated with these
automacros..

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Baret

Hi Graham
I followed the instructions on your link
'http://www.gmayor.com/installing_macro.htm' so I am sure it was in the
document itself - it was under TemplateProject (though there was a new icon
under it then and now saying New Macros as well as the ThisDocument).

I have now deleted the macros from Tools, Macros, Delete and when I open the
template up now I do not get the macros disabled message. Funny thing is it
is opening up with the task pane showing but is is on the 'Getting Started'
palette and not the styles and formatting as originally desired. However, if
I open the file on someone elses machine the task pane is not coming up. Is
that because it is not in the templates folder yet? But as far as I can tell
I have not got that AutoNew AutoOpen script anywhere in the document now
anyway.

Sorry if I am being an idiot - I have no idea about how these macros work!

I just want to create a simple template that people can open up and they can
automatically see the styles and formats that I have created that they need
to use.

If you have the patience to continue to help I would appreciate it!

Baret
 
G

Graham Mayor

The autonew macro runs every time a new document is created from the
template that contains it.
The autoopen macro runs every time the template or the document created from
the template is opened.
For the task pane to open as requested the two macros must be saved in the
document template that requires them. The template must then be saved in a
trusted location. You can set the templates and startup folder to be a
truisted location from tools > options > security > macro security > trusted
publishers. Otherwise you will get a macro warning. I suspect that on
reflection the templates folder is not a trusted location by default.

You cannot force other users to run macros contained in documents or
templates against their will.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Baret

Morning Graham
I have redone the AutoNew and AutoOpen scripts. If I look in the visual
basic editor they appear under TemplateProject within a subfolder called
NewMacros.

If I go to tools, macros I see them both there too but under the description
it reads 'Macro created 28/08/2008 by Baret'. I supsect that should be your
name there?

So I need to add the publisher as a trusted publisher.
I go to tools, macros security, trusted publisher but I cannot add a new
one. I read on help that I need to 'load the add-in that contains macros
certified by the macro developer'.

Is this right so far and if so how do I do the add in part so i can select
Always trust macros from this publisher in the Security Warning box?
Again I apologise for taking up so much of your time!

Regards

Baret
 
G

Graham Mayor

Baret wrote:
Let's start again.

1. Open your template in Word.
2. From tools > macro > macros select 'Macros in' and pick your template
name from the list of macros.
3. Type AutoNew in the box at the top of the dialog and click Create.
The vba editor will open at the right location.
4. Copy the two macros from the previous message to the clipboard (CTRL+C).
5. Select everything in the text space of the vba editor.
6. Paste the contents of the clipboard (CTRL+V)
You should now have the two macros in the correct template (in a module
called NewMacros.
Save the template in the user template folder and close it.
7. From tools > macro > macros select 'Macros in' normal.dot. If the two
macros are still there, delete them.
8. From tools > options > security > macro security > trusted publishers.-
check the checkbox to trust all installed add-ins and templates.
9. Create a new document from your template.
The styles task pane should now be displayed!
10. Save and close that document.
11. Open the document again.
The styles task pane should be displayed.

Does that now work?

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Baret

Ok. Done all that and saved a version in the user templates folder
(Applications, Microsoft, Templates).

I open Word, 'create new document from templates on my computer' and select
my template. It opens fine without the macros disabled message which is great
(if I open the version on my desktop though I still get the disabled macros
message?)
and the task pane automatically shows (without me having to go to view task
pane), however, but it is on 'Getting Started' and not on 'Styles and
Fomatting'??
 
G

Graham Mayor

Baret said:
If I open the version on my desktop though I still
get the disabled macros message?)

The desktop is not a trusted folder!
and the task pane automatically shows (without me having to go to
view task pane), however, but it is on 'Getting Started' and not on
'Styles and Fomatting'??

That's because the desktop version macros are disabled.
 
B

Baret

Hi Graham
So the one in the trusted folder ie Microsoft Templates folder - how come
the syles and formatting task pane is not showing? Why is it showing the
Getting Started task pane when in the script/macro it says to make visible
formatting task pane?

If we could just get that to work in the trusted folder that would be great.
 
G

Graham Mayor

It works for me?
Send me your template to the link on my web site home page.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top