Custom Toolbar remaining invisible

J

John

Hi,

I have a template which we have been using for some time without problems.
It has two custom toolbars. Recently when the document has been re-opened,
the custom toolbars are not visible. They can be made visible by right
clicking on the toolbar area and selecting the two toolbars. But I would
like them to appear at all times.

I have tried adding the following code to the AutoOpen module without
success.

CommandBars("StdLetter").Visible = True
CommandBars("Status").Visible = True

Any suggestions?

Thanks,

John
 
C

Charles Kenyon

Put them in the AutoNew macro if this is a document template. If it is a
global template it takes more.
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
J

John

When a new document is created with the template the Toolbars are both
visible. It's only when the document is saved and re-opened that they don't
appear. Should they still be in AutoNew in that case?

Thanks,

John
 
J

John

I have tried putting those lines in AutoNew but the Toolbars still remain
hidden on re-opening.

John
 
J

John

To answer another question you had, this is not a Global template. I also
found that if I had an error in the code and the Debug option was presented,
then the Toolbars both show.

I also find that if I put the same lines in another module and run them then
the Toolbars appear as well. I just can't work out what's happening.

John
 
L

Larry

I don't know if this will help, but I have something similar to that
which works. I have a tables.dot template in which the tables and
borders toolbar opens opens automatically when I run a macro to create a
new document based on that toolbar. In the Tables template, I have the
toolbar displayed in both the AutoNew and the AutoOpen, and have it
hidden when I close the document.


Sub AutoNew()
' display Tables toolbar
With CommandBars("Tables and Borders")
.Visible = True
.Position = msoBarFloating
End With
Application.WindowState = wdWindowStateMaximize
End Sub

Sub AutoOpen()
' display Tables toolbar
With CommandBars("Tables and Borders")
.Visible = True
.Position = msoBarFloating
End With

Sub AutoClose()
' hide Table toolbar
With CommandBars("Tables and Borders")
.Visible = False
.Position = msoBarFloating
End With
Application.ScreenUpdating = False
Application.WindowState = wdWindowStateNormal
End Sub
 
J

John

Hi Charles,

I have found what the problem is and it probably relates to part of what you
said. On some workstations we have Adobe Acrobat installed and it loads a
Global template in Word to provide functionality including a custom toolbar.
If I turn off this template then my template works fine.

Is there some way I can leave the Adobe template active and not have the
Toolbar problem?

Thanks,

John
 
J

John

I used some code to delay the displaying of my toolbar by 1 second if the
Adobe Add-in is present. This gives the Adobe one time to run and finish. It
now works fine.

Thanks to everyone for your help.

John
 
C

Charles Kenyon

To have the toolbar display when a document based on the template is
reopened, the commands should be in the AutoOpen macro or the Document_Open
event handler in your template. Note these will only run so long as the
document remains attached to the template.
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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