A Fix For Word Crashing

R

Rafael Montserrat

Word 2004
OS X v 10.4.7

Hi,

I found this on <macfixit.com> and I deleted those files because my Word
2004 crashes a lot. Everything¹s been OK, but it¹s just been a couple of
days since I deleted them. Any feedback on this?

Thanks

Rafael


³http://www.macfixit.com/article.php?story=20060710091708300
Monday, July 10 2006 @ 09:17 AM PDT
Mac OS X 10.4.7 Special Report: Microsoft Word crashing frequently -- fix

If you are experiencing repeated unexpected quits or freezes from any
version of Microsoft Word after updating to Mac OS X 10.4.7, font issues may
be at play. Try deleting the following files/folders:

~/Library/Caches/com.microsoft.browserfont.cache
~/Library/Preferences/Microsoft/Office Font Cache

and check for persistence of the issue.²
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Rafael:

When Word crashes "a lot" it is usually due to corrupt documents.

When it crashes "every time", THEN there's something wrong with it :)

Deleting font caches won't do any harm (they'll be rebuilt...) but it's not
likely to solve problems unless you are getting crashes almost every time
you start Word.

Cheers


Word 2004
OS X v 10.4.7

Hi,

I found this on <macfixit.com> and I deleted those files because my Word
2004 crashes a lot. Everything¹s been OK, but it¹s just been a couple of
days since I deleted them. Any feedback on this?

Thanks

Rafael


³http://www.macfixit.com/article.php?story=20060710091708300
Monday, July 10 2006 @ 09:17 AM PDT
Mac OS X 10.4.7 Special Report: Microsoft Word crashing frequently -- fix

If you are experiencing repeated unexpected quits or freezes from any
version of Microsoft Word after updating to Mac OS X 10.4.7, font issues may
be at play. Try deleting the following files/folders:

~/Library/Caches/com.microsoft.browserfont.cache
~/Library/Preferences/Microsoft/Office Font Cache

and check for persistence of the issue.²

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
R

Rafael Montserrat

Hi John,

It crashes 'occasionally', or did. But too often, and even though I
frequently click the 'Save All' icon‹the one with the three floppies‹I would
still lose all my carefully built custom menus and toolbars. Recently I
realized ‹duh‹ that I had created them from toolbars (I now have five,
Custom 1 through Custom 5), in Customize Toolbars>Toolbars, so I thought
that if there was a crash, but I had been careful and frequently clicked
"Save As", that they would be there for me. Wrong. They had disappeared
with the crash.

The other day, in a NG conversation, one of your peers was saying that he
did *everything* with keystrokes. That's a good goal to shoot for. Still,
the toolbars, along with macros I've learned here at the NG, are great

But the crashing.... I know I've brought it up before here. I'll have to
look into the cause and the fix more carefully if it continues. I've lost
stuff that took me time to create.

Thanks,

Rafael
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Rafael:

{Grin} If you play around with customising menus and toolbars, it causes
frequent crashes :)

I strongly suggest that you create NEW toolbars: never customise the default
toolbars.

If you customise default toolbars, you are setting up conflicts between the
hard-coded defaults and your own work. That's guaranteed to make Word
unstable.

Instead: Create new toolbars with your own names, and copy to them any
commands you want from the standard toolbars. Provided that you "Save All"
each time you make a change, you will never lose them, no matter how often
Word crashes.

Unless, of course, the crash is because you have corrupted Normal template.
If that happens, Word will overwrite it with a new blank one and everything
in there will be gone.

There are two ways to handle that: Create a Global Add-In, or backup your
Normal template. Creating a global add-in is simple: just create a new
template and put it in your Word startup folder. However, adding
customisations to it, and editing it, becomes complex and fiddly.

I prefer to add my customisations to the Normal template. But once I have
something running "right", I then make a copy of the Normal template. I
have dated copies of Normal going back about ten years. That way, if I ever
lose the Normal template, I can simply create a new one and copy everything
back in from one of its predecessors.

That's another reason for creating your OWN toolbars: You cannot copy the
default toolbars in from a backup, but you can copy the ones you create.

Hope this helps


Hi John,

It crashes 'occasionally', or did. But too often, and even though I
frequently click the 'Save All' icon‹the one with the three floppies‹I would
still lose all my carefully built custom menus and toolbars. Recently I
realized ‹duh‹ that I had created them from toolbars (I now have five,
Custom 1 through Custom 5), in Customize Toolbars>Toolbars, so I thought
that if there was a crash, but I had been careful and frequently clicked
"Save As", that they would be there for me. Wrong. They had disappeared
with the crash.

The other day, in a NG conversation, one of your peers was saying that he
did *everything* with keystrokes. That's a good goal to shoot for. Still,
the toolbars, along with macros I've learned here at the NG, are great

But the crashing.... I know I've brought it up before here. I'll have to
look into the cause and the fix more carefully if it continues. I've lost
stuff that took me time to create.

Thanks,

Rafael

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
C

Clive Huggan

Hello Rafael,

If you want a little more than John has said (though essentially the same
principles), look under the heading "Why is it best not to alter the default
toolbars?" in "Bend Word to Your Will", available as a free download from
the Word MVPs' website
(http://word.mvps.org/Mac/Bend/BendWordToYourWill.html).

Cheers,
Clive Huggan
=============
 
R

Rafael Montserrat

OK Clive, I will.

John,

OK about not customizing default tool bars and creating new ones. But how
about this:
1. I often want to remove half the icons on a default toolbar because I
don't need them. Is removing icons OK?
2. To arrange toolbars easily, I've begun making quite short toolbars. Is
dividing default toolbars, taking a half of the icons from one, and putting
them in a new toolbar considered customizing?
A stretch?

In these examples, the only thing I wouldn't be doing to the default
toolbar, is adding anything into.

Thanks,

Rafael

PS
I've already had two crashes this morning. I'm keeping a log. One happened
just as I pasted html into the ebay window. I have, though, pasted a dozen
htmls into the ebay window. Lost some, not all, of my custom toolbars.



Hi Rafael:

{Grin} If you play around with customising menus and toolbars, it causes
frequent crashes :)

I strongly suggest that you create NEW toolbars: never customise the default
toolbars.

If you customise default toolbars, you are setting up conflicts between the
hard-coded defaults and your own work. That's guaranteed to make Word
unstable.

Instead: Create new toolbars with your own names, and copy to them any
commands you want from the standard toolbars. Provided that you "Save All"
each time you make a change, you will never lose them, no matter how often
Word crashes.

Unless, of course, the crash is because you have corrupted Normal template.
If that happens, Word will overwrite it with a new blank one and everything
in there will be gone.

There are two ways to handle that: Create a Global Add-In, or backup your
Normal template. Creating a global add-in is simple: just create a new
template and put it in your Word startup folder. However, adding
customisations to it, and editing it, becomes complex and fiddly.

I prefer to add my customisations to the Normal template. But once I have
something running "right", I then make a copy of the Normal template. I
have dated copies of Normal going back about ten years. That way, if I ever
lose the Normal template, I can simply create a new one and copy everything
back in from one of its predecessors.

That's another reason for creating your OWN toolbars: You cannot copy the
default toolbars in from a backup, but you can copy the ones you create.
 
B

Beth Rosengard

Hi Rafael,

ANY change you make to a default toolbar would be considered a customization
and if the toolbar goes south, so will the change. So create a custom
toolbar and put on it only your preferred items from the default toolbar.
Then close the default toolbar and just use your custom one. IOW, if the
toolbar was created by Word in the first place (a default toolbar), you will
lose any and all changes you made to it next time you have one of these
crashes.

As for the frequent crashes, have you worked through all the troubleshooting
procedures at <http://word.mvps.org/mac/TroubleshootingIndex.html>? For
instance, have you checked the possibility of third-part software conflicts?

--
***Please always reply to the newsgroup!***

Beth Rosengard
MacOffice MVP

Mac Word FAQ: <http://word.mvps.org/Mac/WordMacHome.html>
My Site: <http://www.bethrosengard.com>
 
R

Rafael Montserrat

Hi Beth,

That's a good solution. This last crash, some of the custom toolbars
survived. By your definition, I must have made these from scratch. The
ones that disappeared were probably built up on a default toolbar.

Thanks for the article too.

Rafael
 
D

Daiya Mitchell

Hi Rafael,

Well, you should be able to tell for sure which ones you lost, not just go
from Beth's definition. Can you confirm which type got lost?

Word doesn't let you rename the default toolbars, so anything you named
yourself you must have created. I assume you can recognize Word's names.

Daiya
 
D

Daiya Mitchell

Hi Rafael,

Some questions, just to clarify‹

1) When Word crashed, and you lost some of your custom toolbars, had you
been customizing (removing, etc) them in *that* session of Word? (By
session, I mean since the last time you started Word)

2) When you say "lost toolbars" do you mean that there is no longer Custom
1, etc, listed under View | Toolbars, and you had to recreate it? Or do you
mean that Word forgot to show Custom 1, and you had to turn it back on? Or
do you mean that you changed a default toolbar, and the changes are no
longer there?

3) How often do you usually quit and restart Word? Do you leave it running
for days, or restart it in the mornings?

4) When Word crashes, do you do anything beside just restarting it?

5) When you customize toolbars, do you do anything to save them anywhere
besides the default Normal template?

Daiya

PS. Do work through the Troubleshooting Index. Under OS 9/Word 2001, Word
crashed without fail at least once a day for me. But my Word 2004 has
*maybe* crashed twice in two years. And it might be once, or even never.
Many people report this, so something is likely screwy on your machine or
about your setup or habits.

Since you are keeping a log, make sure you note what you are doing when it
crashes.
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Rafael:

On 31/8/06 6:24 AM, in article C11B41F9.1D9E%[email protected],

Inline...
OK about not customizing default tool bars and creating new ones. But how
about this:
1. I often want to remove half the icons on a default toolbar because I
don't need them. Is removing icons OK?

No. Create new toolbars, copy the buttons you DO need to the new ones, then
HIDE the old ones.
2. To arrange toolbars easily, I've begun making quite short toolbars. Is
dividing default toolbars, taking a half of the icons from one, and putting
them in a new toolbar considered customizing?

Yes. Copy them, don't move them.
In these examples, the only thing I wouldn't be doing to the default
toolbar, is adding anything into.

For a long and happy life, don't "change" the default toolbars. Make new
toolbars the way you want them.

Here: You'll need this:

Option Explicit

Sub AutoExec()
Call SetToolbars
End Sub
Sub AutoOpen()
Call SetToolbars
End Sub
Sub AutoNew()
Call SetToolbars
End Sub
Sub AutoClose()
Call SetToolbars
End Sub
Sub AutoExit()
Call SetToolbars
End Sub

Sub SetToolbars()
' Brings up Customised toolbars
' Copyright 19 May 2003 by John McGhie
' McGhie Information Engineering Pty Ltd

' This macro tests for the presence of customised toolbars available
' to the active document, and displays them if present.
' Otherwise, it displays the personal customised toolbars.

' Constants provide a simple way of changing toolbar names in a single place
' The following four strings are all you need to change
' when moving from customer site to customer site

Option Explicit

' This is the common code base for all three Custom Templates

Public Const CustomerFormatting As String = "John Formatting"
Public Const CustomerStandard As String = "John Standard"
Public Const CustomerTools As String = ""
Public Const DefaultFormatting As String = "Formatting"
Public Const DefaultStandard As String = "Standard"

Dim aToolbar As CommandBar
Dim tbStandard As CommandBar
Dim tbFormatting As CommandBar
Dim tbCustStd As CommandBar
Dim tbCustFormatting As CommandBar
Dim ToolRowIndex As Integer
Dim MessageString As String


If Application.Documents.Count > 0 Then
' The user can leave us in a state where there are no active documents. If
' they do, we must not try to manipulate toolbars, otherwise we get an
error.

#If Mac = False Then
With ActiveDocument
If .EmbedSmartTags = True Then .EmbedSmartTags = False
If .EmbedLinguisticData = True Then .EmbedLinguisticData = False
End With
#End If

Set tbStandard = Application.CommandBars(CustomerStandard)
Set tbFormatting = Application.CommandBars(CustomerFormatting)

For Each aToolbar In Application.CommandBars
' First, enumerate the CommandBars collection to make sure the
' customer toolbars are available. If they're not, the code
' would emit a runtime error we want to trap and handle.

With aToolbar
' If the toolbar is already visible, it will not be enabled
' If it is not enabled, the code throws an undefined error in Wd97
If .Enabled = True And .Protection = msoBarNoProtection Then
Select Case .Name
Case CustomerStandard
Set tbStandard = aToolbar
Case CustomerFormatting
Set tbFormatting = aToolbar
Case "Web", "Reviewing"
If .Visible = True Then .Visible = False
If .Enabled = True Then .Enabled = False
Case Else
' aToolbar.Visible = False
End Select
End If
End With
Next aToolbar

' Now we display whatever we found

With tbStandard
.Visible = True
.RowIndex = 8 ' Docking order
.Left = 0
End With

With tbFormatting
.Visible = True
.RowIndex = 9 ' Docking order
.Left = 0
End With
End If

GoTo alldone ' Exit the macro without running the error code

ErrorNotFound: ' Error handler
MessageString = "One or more of the customised toolbars are missing. " _
& vbLf & vbLf & "Ask Help Desk to restore them, or disable the macro. "
' Be kind, tell the user which ones are missing :)
If tbStandard = "" Then MessageString = MessageString & vbLf & vbLf &
DefaultStandard & " is missing."
If tbFormatting = "" Then MessageString = MessageString & vbLf & vbLf &
DefaultFormatting & " is missing."
MsgBox MessageString, vbExclamation + vbOKOnly, "Toolbar Macro"

alldone:
End Sub
Thanks,

Rafael

PS
I've already had two crashes this morning. I'm keeping a log. One happened
just as I pasted html into the ebay window. I have, though, pasted a dozen
htmls into the ebay window. Lost some, not all, of my custom toolbars.



Hi Rafael:

{Grin} If you play around with customising menus and toolbars, it causes
frequent crashes :)

I strongly suggest that you create NEW toolbars: never customise the default
toolbars.

If you customise default toolbars, you are setting up conflicts between the
hard-coded defaults and your own work. That's guaranteed to make Word
unstable.

Instead: Create new toolbars with your own names, and copy to them any
commands you want from the standard toolbars. Provided that you "Save All"
each time you make a change, you will never lose them, no matter how often
Word crashes.

Unless, of course, the crash is because you have corrupted Normal template.
If that happens, Word will overwrite it with a new blank one and everything
in there will be gone.

There are two ways to handle that: Create a Global Add-In, or backup your
Normal template. Creating a global add-in is simple: just create a new
template and put it in your Word startup folder. However, adding
customisations to it, and editing it, becomes complex and fiddly.

I prefer to add my customisations to the Normal template. But once I have
something running "right", I then make a copy of the Normal template. I
have dated copies of Normal going back about ten years. That way, if I ever
lose the Normal template, I can simply create a new one and copy everything
back in from one of its predecessors.

That's another reason for creating your OWN toolbars: You cannot copy the
default toolbars in from a backup, but you can copy the ones you create.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
N

Nellie

Crash problem not associated with altering tool bars.
I am editing a MS Word manuscript sent to me from a university faculty
member in Japan using the track changes function so that my client can see
how I've changed the manuscript. I'm about 25 pages into a 125 page document
and it has started crashing every word or two. How can I stop this? Or if
this is a "corrupt document", what do I do to fix it? Nellie

John McGhie [MVP - Word and Word Macinto said:
Hi Rafael:

On 31/8/06 6:24 AM, in article C11B41F9.1D9E%[email protected],

Inline...
OK about not customizing default tool bars and creating new ones. But how
about this:
1. I often want to remove half the icons on a default toolbar because I
don't need them. Is removing icons OK?

No. Create new toolbars, copy the buttons you DO need to the new ones, then
HIDE the old ones.
2. To arrange toolbars easily, I've begun making quite short toolbars. Is
dividing default toolbars, taking a half of the icons from one, and putting
them in a new toolbar considered customizing?

Yes. Copy them, don't move them.
In these examples, the only thing I wouldn't be doing to the default
toolbar, is adding anything into.

For a long and happy life, don't "change" the default toolbars. Make new
toolbars the way you want them.

Here: You'll need this:

Option Explicit

Sub AutoExec()
Call SetToolbars
End Sub
Sub AutoOpen()
Call SetToolbars
End Sub
Sub AutoNew()
Call SetToolbars
End Sub
Sub AutoClose()
Call SetToolbars
End Sub
Sub AutoExit()
Call SetToolbars
End Sub

Sub SetToolbars()
' Brings up Customised toolbars
' Copyright 19 May 2003 by John McGhie
' McGhie Information Engineering Pty Ltd

' This macro tests for the presence of customised toolbars available
' to the active document, and displays them if present.
' Otherwise, it displays the personal customised toolbars.

' Constants provide a simple way of changing toolbar names in a single place
' The following four strings are all you need to change
' when moving from customer site to customer site

Option Explicit

' This is the common code base for all three Custom Templates

Public Const CustomerFormatting As String = "John Formatting"
Public Const CustomerStandard As String = "John Standard"
Public Const CustomerTools As String = ""
Public Const DefaultFormatting As String = "Formatting"
Public Const DefaultStandard As String = "Standard"

Dim aToolbar As CommandBar
Dim tbStandard As CommandBar
Dim tbFormatting As CommandBar
Dim tbCustStd As CommandBar
Dim tbCustFormatting As CommandBar
Dim ToolRowIndex As Integer
Dim MessageString As String


If Application.Documents.Count > 0 Then
' The user can leave us in a state where there are no active documents. If
' they do, we must not try to manipulate toolbars, otherwise we get an
error.

#If Mac = False Then
With ActiveDocument
If .EmbedSmartTags = True Then .EmbedSmartTags = False
If .EmbedLinguisticData = True Then .EmbedLinguisticData = False
End With
#End If

Set tbStandard = Application.CommandBars(CustomerStandard)
Set tbFormatting = Application.CommandBars(CustomerFormatting)

For Each aToolbar In Application.CommandBars
' First, enumerate the CommandBars collection to make sure the
' customer toolbars are available. If they're not, the code
' would emit a runtime error we want to trap and handle.

With aToolbar
' If the toolbar is already visible, it will not be enabled
' If it is not enabled, the code throws an undefined error in Wd97
If .Enabled = True And .Protection = msoBarNoProtection Then
Select Case .Name
Case CustomerStandard
Set tbStandard = aToolbar
Case CustomerFormatting
Set tbFormatting = aToolbar
Case "Web", "Reviewing"
If .Visible = True Then .Visible = False
If .Enabled = True Then .Enabled = False
Case Else
' aToolbar.Visible = False
End Select
End If
End With
Next aToolbar

' Now we display whatever we found

With tbStandard
.Visible = True
.RowIndex = 8 ' Docking order
.Left = 0
End With

With tbFormatting
.Visible = True
.RowIndex = 9 ' Docking order
.Left = 0
End With
End If

GoTo alldone ' Exit the macro without running the error code

ErrorNotFound: ' Error handler
MessageString = "One or more of the customised toolbars are missing. " _
& vbLf & vbLf & "Ask Help Desk to restore them, or disable the macro. "
' Be kind, tell the user which ones are missing :)
If tbStandard = "" Then MessageString = MessageString & vbLf & vbLf &
DefaultStandard & " is missing."
If tbFormatting = "" Then MessageString = MessageString & vbLf & vbLf &
DefaultFormatting & " is missing."
MsgBox MessageString, vbExclamation + vbOKOnly, "Toolbar Macro"

alldone:
End Sub
Thanks,

Rafael

PS
I've already had two crashes this morning. I'm keeping a log. One happened
just as I pasted html into the ebay window. I have, though, pasted a dozen
htmls into the ebay window. Lost some, not all, of my custom toolbars.



Hi Rafael:

{Grin} If you play around with customising menus and toolbars, it causes
frequent crashes :)

I strongly suggest that you create NEW toolbars: never customise the default
toolbars.

If you customise default toolbars, you are setting up conflicts between the
hard-coded defaults and your own work. That's guaranteed to make Word
unstable.

Instead: Create new toolbars with your own names, and copy to them any
commands you want from the standard toolbars. Provided that you "Save All"
each time you make a change, you will never lose them, no matter how often
Word crashes.

Unless, of course, the crash is because you have corrupted Normal template.
If that happens, Word will overwrite it with a new blank one and everything
in there will be gone.

There are two ways to handle that: Create a Global Add-In, or backup your
Normal template. Creating a global add-in is simple: just create a new
template and put it in your Word startup folder. However, adding
customisations to it, and editing it, becomes complex and fiddly.

I prefer to add my customisations to the Normal template. But once I have
something running "right", I then make a copy of the Normal template. I
have dated copies of Normal going back about ten years. That way, if I ever
lose the Normal template, I can simply create a new one and copy everything
back in from one of its predecessors.

That's another reason for creating your OWN toolbars: You cannot copy the
default toolbars in from a backup, but you can copy the ones you create.
 
J

John McGhie [MVP -- Word and Word Mac]

Hi Nellie:

Yes, it's a corrupt document.

You need to "Maggie" it.

You also need to turn Change Tracking OFF while you're working on it, and
use Compare Documents to put the revision marking in at the end.

1) Reveal the Reviewing toolbar and choose "Accept all changes in document"

2) Create a new, blank document

3) Carefully copy all EXCEPT the very last paragraph mark

4) Paste into the new document

5) Save under a new name

6) Ensure Track Changes is turned off (not hidden...) In other words, be
sure you have turned OFF the "TRK" button at the bottom of the screen rather
than simply chosing a display view that hides the changes.

Your numbered lists are probably the cause of the problem. Run your eye
down the fixed document and repair anything that went wrong when you Maggied
it. Numbered lists that were not applied by styles are the most likely
cause of tracked-changes inspired corruption.

When you have finished making changes, use Compare Documents against the
original. Every change you have made will be shown as a revision.

Hope this helps

--

John McGhie <[email protected]>
Business Analyst, Consultant Technical Writer
Microsoft MVP (Word, Word for Mac)
Sydney, Australia +61 (0)4 1209 1410

Nellie said:
Crash problem not associated with altering tool bars.
I am editing a MS Word manuscript sent to me from a university faculty
member in Japan using the track changes function so that my client can see
how I've changed the manuscript. I'm about 25 pages into a 125 page
document
and it has started crashing every word or two. How can I stop this? Or
if
this is a "corrupt document", what do I do to fix it? Nellie

John McGhie [MVP - Word and Word Macinto said:
Hi Rafael:

On 31/8/06 6:24 AM, in article
C11B41F9.1D9E%[email protected],

Inline...
OK about not customizing default tool bars and creating new ones. But
how
about this:
1. I often want to remove half the icons on a default toolbar because I
don't need them. Is removing icons OK?

No. Create new toolbars, copy the buttons you DO need to the new ones,
then
HIDE the old ones.
2. To arrange toolbars easily, I've begun making quite short toolbars.
Is
dividing default toolbars, taking a half of the icons from one, and
putting
them in a new toolbar considered customizing?

Yes. Copy them, don't move them.
In these examples, the only thing I wouldn't be doing to the default
toolbar, is adding anything into.

For a long and happy life, don't "change" the default toolbars. Make new
toolbars the way you want them.

Here: You'll need this:

Option Explicit

Sub AutoExec()
Call SetToolbars
End Sub
Sub AutoOpen()
Call SetToolbars
End Sub
Sub AutoNew()
Call SetToolbars
End Sub
Sub AutoClose()
Call SetToolbars
End Sub
Sub AutoExit()
Call SetToolbars
End Sub

Sub SetToolbars()
' Brings up Customised toolbars
' Copyright 19 May 2003 by John McGhie
' McGhie Information Engineering Pty Ltd

' This macro tests for the presence of customised toolbars available
' to the active document, and displays them if present.
' Otherwise, it displays the personal customised toolbars.

' Constants provide a simple way of changing toolbar names in a single
place
' The following four strings are all you need to change
' when moving from customer site to customer site

Option Explicit

' This is the common code base for all three Custom Templates

Public Const CustomerFormatting As String = "John Formatting"
Public Const CustomerStandard As String = "John Standard"
Public Const CustomerTools As String = ""
Public Const DefaultFormatting As String = "Formatting"
Public Const DefaultStandard As String = "Standard"

Dim aToolbar As CommandBar
Dim tbStandard As CommandBar
Dim tbFormatting As CommandBar
Dim tbCustStd As CommandBar
Dim tbCustFormatting As CommandBar
Dim ToolRowIndex As Integer
Dim MessageString As String


If Application.Documents.Count > 0 Then
' The user can leave us in a state where there are no active documents.
If
' they do, we must not try to manipulate toolbars, otherwise we get an
error.

#If Mac = False Then
With ActiveDocument
If .EmbedSmartTags = True Then .EmbedSmartTags = False
If .EmbedLinguisticData = True Then .EmbedLinguisticData = False
End With
#End If

Set tbStandard = Application.CommandBars(CustomerStandard)
Set tbFormatting = Application.CommandBars(CustomerFormatting)

For Each aToolbar In Application.CommandBars
' First, enumerate the CommandBars collection to make sure the
' customer toolbars are available. If they're not, the code
' would emit a runtime error we want to trap and handle.

With aToolbar
' If the toolbar is already visible, it will not be enabled
' If it is not enabled, the code throws an undefined error in Wd97
If .Enabled = True And .Protection = msoBarNoProtection Then
Select Case .Name
Case CustomerStandard
Set tbStandard = aToolbar
Case CustomerFormatting
Set tbFormatting = aToolbar
Case "Web", "Reviewing"
If .Visible = True Then .Visible = False
If .Enabled = True Then .Enabled = False
Case Else
' aToolbar.Visible = False
End Select
End If
End With
Next aToolbar

' Now we display whatever we found

With tbStandard
.Visible = True
.RowIndex = 8 ' Docking order
.Left = 0
End With

With tbFormatting
.Visible = True
.RowIndex = 9 ' Docking order
.Left = 0
End With
End If

GoTo alldone ' Exit the macro without running the error code

ErrorNotFound: ' Error handler
MessageString = "One or more of the customised toolbars are missing. " _
& vbLf & vbLf & "Ask Help Desk to restore them, or disable the macro.
"
' Be kind, tell the user which ones are missing :)
If tbStandard = "" Then MessageString = MessageString & vbLf & vbLf &
DefaultStandard & " is missing."
If tbFormatting = "" Then MessageString = MessageString & vbLf & vbLf
&
DefaultFormatting & " is missing."
MsgBox MessageString, vbExclamation + vbOKOnly, "Toolbar Macro"

alldone:
End Sub
Thanks,

Rafael

PS
I've already had two crashes this morning. I'm keeping a log. One
happened
just as I pasted html into the ebay window. I have, though, pasted a
dozen
htmls into the ebay window. Lost some, not all, of my custom toolbars.



Hi Rafael:

{Grin} If you play around with customising menus and toolbars, it
causes
frequent crashes :)

I strongly suggest that you create NEW toolbars: never customise the
default
toolbars.

If you customise default toolbars, you are setting up conflicts between
the
hard-coded defaults and your own work. That's guaranteed to make Word
unstable.

Instead: Create new toolbars with your own names, and copy to them any
commands you want from the standard toolbars. Provided that you "Save
All"
each time you make a change, you will never lose them, no matter how
often
Word crashes.

Unless, of course, the crash is because you have corrupted Normal
template.
If that happens, Word will overwrite it with a new blank one and
everything
in there will be gone.

There are two ways to handle that: Create a Global Add-In, or backup
your
Normal template. Creating a global add-in is simple: just create a new
template and put it in your Word startup folder. However, adding
customisations to it, and editing it, becomes complex and fiddly.

I prefer to add my customisations to the Normal template. But once I
have
something running "right", I then make a copy of the Normal template.
I
have dated copies of Normal going back about ten years. That way, if I
ever
lose the Normal template, I can simply create a new one and copy
everything
back in from one of its predecessors.

That's another reason for creating your OWN toolbars: You cannot copy
the
default toolbars in from a backup, but you can copy the ones you
create.

Hope this helps





Hello Rafael,

If you want a little more than John has said (though essentially the
same
principles), look under the heading "Why is it best not to alter the
default
toolbars?" in "Bend Word to Your Will", available as a free download
from
the Word MVPs' website
(http://word.mvps.org/Mac/Bend/BendWordToYourWill.html).

Cheers,
Clive Huggan
=============

On 30/8/06 7:48 PM, in article C11B9C2A.44B86%[email protected], "John
McGhie



On 30/8/06 9:44 AM, in article
C11A1F54.1D72%[email protected],

Hi John,

It crashes 'occasionally', or did. But too often, and even though I
frequently click the 'Save All' icon<the one with the three
floppies<I
would
still lose all my carefully built custom menus and toolbars.
Recently I
realized <duh< that I had created them from toolbars (I now have
five,
Custom 1 through Custom 5), in Customize Toolbars>Toolbars, so I
thought
that if there was a crash, but I had been careful and frequently
clicked
"Save As", that they would be there for me. Wrong. They had
disappeared
with the crash.

The other day, in a NG conversation, one of your peers was saying
that he
did *everything* with keystrokes. That's a good goal to shoot for.
Still,
the toolbars, along with macros I've learned here at the NG, are
great

But the crashing.... I know I've brought it up before here. I'll
have to
look into the cause and the fix more carefully if it continues.
I've lost
stuff that took me time to create.

Thanks,

Rafael



Hi Rafael:

When Word crashes "a lot" it is usually due to corrupt documents.

When it crashes "every time", THEN there's something wrong with it
:)

Deleting font caches won't do any harm (they'll be rebuilt...) but
it's
not
likely to solve problems unless you are getting crashes almost
every time
you start Word.

Cheers


On 29/8/06 1:05 PM, in article
C118FD05.1D2D%[email protected],

Word 2004
OS X v 10.4.7

Hi,

I found this on <macfixit.com> and I deleted those files because
my Word
2004 crashes a lot. Everything¹s been OK, but it¹s just been a
couple of
days since I deleted them. Any feedback on this?

Thanks

Rafael


³http://www.macfixit.com/article.php?story=20060710091708300
Monday, July 10 2006 @ 09:17 AM PDT
Mac OS X 10.4.7 Special Report: Microsoft Word crashing
frequently -- fix

If you are experiencing repeated unexpected quits or freezes from
any
version of Microsoft Word after updating to Mac OS X 10.4.7, font
issues
may
be at play. Try deleting the following files/folders:

~/Library/Caches/com.microsoft.browserfont.cache
~/Library/Preferences/Microsoft/Office Font Cache

and check for persistence of the issue.²
 

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