I am having a heck of a time trying to get a Word file to behave. I wrote a table in Excel and pasted it into a new, blank Word file. Now Word won't let me format the table. I want the table to fit the size of my paper, and I want to adjust the column
widths to a more visually pleasing format. Instead Word insists on using the automatic formats; I can't turn them off in "Table Properties." "Auto Fit" won't work; the table remains 23 inches long (in landscape mode.) I try to drag the gridlines in the
table; when I release them, they snap back to where they were. I try to quit; a dialog box appears and says that Word won't execute an unspecified code in break mode (whatever that is.) I have to force-quit Word to get rid of the dialog box.
When I reopen the file, I get this dialog box:

Word gives the following diagnostic report. Does this report mean anything to anyone here? TIA
Option
Explicit
Sub AutoExec()
Dim docReady As
Integer
docReady = Application.Documents.Count
' See if we have a document yet
If docReady < 1
Then
' Wait 1 sec then call itself recursively
Application.OnTime Now + TimeValue("00:00:01"), "AutoExec"
End If
ReadView
' Checks for a stored view, and restores it if there is one
If ActiveDocument.Bookmarks.Exists("macroMarkHere")
Then gotoSpot ' restores cursor location
End
Sub
Sub AutoOpen()
ReadView
' Checks for a stored view, and restores it if there is one
If ActiveDocument.Bookmarks.Exists("macroMarkHere")
Then gotoSpot ' restores cursor location
End
Sub
Sub AutoNew()
ReadView
' Checks for a stored view, and restores it if there is one
End
Sub
Sub AutoClose()
WriteView
' Writes the view into the document
End
Sub
Sub FileSave()
' This macro intercepts FileSave commands and calls WriteView
' Because Mac Word has no document events
' Macro written 22 Nov 2010 by John McGhie
' (c) Copyright McGhie Information Engineering Pty Ltd, November 2010
With ActiveDocument
WriteView
' Writes the view into the document
If .Path = .Name
Then
' Document has never been saved
Dialogs(wdDialogFileSaveAs).Show
Else
.Save
End If
End
With
End
Sub
Function markSpot()
Selection.Collapse
Selection.Bookmarks.add Name:="macroMarkHere", Range:=Selection.Range
End
Function
Function gotoSpot()
Selection.GoTo What:=wdGoToBookmark, Name:="macroMarkHere"
End
Function
Function CheckVersion()
Dim appVersion
As Integer
appVersion = Val(Left(Application.Version, 2))
If System.OperatingSystem = "Macintosh"
And Application.Name = "Microsoft Word"
And appVersion > 13 Then
' It 's OK
CheckVersion =
True
Else
MsgBox "Sorry, the Restore View Macros cannot run here. They require Microsoft Word at version 2011 or better.", vbCritical + vbOKOnly, "Restore View Macros"
End
End
If
End
Function
Sub WriteView()
' Writes current document display properties into the document on save
' Macro written 22 Nov 2010 by John McGhie
' (c) Copyright McGhie Information Engineering Pty Ltd, November 2010
Dim aDoc
As Document
If CheckVersion =
True
Then ' We're not in an old version
If Application.Documents.Count > 0
Then
' The user can leave us with no documents
Set aDoc = ActiveDocument
With aDoc
If .Content.End > 1
Then
' Don't bother if document has no content
If Not .ReadOnly
Then ' or document is read-only
markSpot
' marks cursor location
With Application.ActiveWindow
' Window state will be 0 if it's Normal, add 1 so we can tell if we have one
CSVars aDoc, "WindowState", .WindowState + 1
CSVars aDoc, "WindowTop", .Top
CSVars aDoc, "WindowLeft", .Left
CSVars aDoc, "WindowWidth", .Width
CSVars aDoc, "WindowHeight", .Height
CSVars aDoc, "WindowZoom", .View.Zoom
End With
' ActiveWindow
End If ' Read-only
End If ' No content
End With ' aDoc
End
If ' No documents
End
If
End
Sub
Sub ReadView()
' Reads document display properties stored in the document and sets the view
' Macro written 22 Nov 2010 by John McGhie
' (c) Copyright McGhie Information Engineering Pty Ltd, November 2010
Dim aDoc
As Document
Dim varWindowState
As Integer
Dim intTop
As Long, intLeft
As Long, intWidth
As Long, intHeight
As Long, intZoom
As Long
If CheckVersion =
True Then
If Application.Documents.Count = 0 Then
End
If ActiveDocument.ReadOnly =
False
Then ' The user can leave us with no documents, or a read-only document
Set aDoc = ActiveDocument ' The one we just opened
varWindowState = ReadVars(aDoc, "WindowState")
' Read stored window state
' We add 1 to varWindowState when storing, because it won't be returned if it's 0
If varWindowState = 1
Then
' if not, the other parameters can have no effect
aDoc.ActiveWindow.WindowState = wdWindowStateNormal
' neither maximised nor minimised
intTop = ReadVars(aDoc, "WindowTop")
' Read stored properties if they exist
intLeft = ReadVars(aDoc, "WindowLeft")
intWidth = ReadVars(aDoc, "WindowWidth")
intHeight = ReadVars(aDoc, "WindowHeight")
intZoom = ReadVars(aDoc, "WindowZoom")
' The stored properties are in points: If too big, set to the current maximum
If intLeft > Application.UsableWidth Then intLeft = 0
' Prevents document opening off screen
If intWidth > Application.UsableWidth Then intWidth = Application.UsableWidth
If intHeight > Application.UsableHeight Then intWidth = Application.UsableHeight
With aDoc.ActiveWindow
' If the properties were not stored in the document, they will come back as zero
If intTop > 0 Then .Top = intTop
If intLeft > 0 Then .Left = intLeft
If intWidth > 0 Then .Width = intWidth
If intHeight > 0 Then .Height = intHeight
If intZoom > 0 Then .View.Zoom = intZoom
End With
End If
End If
End
If
End
Sub
Function CSVars(aDoc
As Document, variableName
As String, varValue
As Variant)
' Tests for the named variable, creates it if needed, then sets it
' Macro written 22 Nov 2010 by John McGhie
' (c) Copyright McGhie Information Engineering Pty Ltd, November 2010
Dim aVar
As Variable
With aDoc
For Each aVar
In aDoc.Variables
If aVar.Name = variableName Then
aVar.Value = varValue
Exit Function
End If
Next
' aVar
aDoc.Variables.add Name:=variableName, Value:=varValue
End
With
End
Function
Function ReadVars(aDoc
As Document, variableName
As String)
' Returns variable if it exists
' Macro written 22 Nov 2010 by John McGhie
' (c) Copyright McGhie Information Engineering Pty Ltd, November 2010
Dim aVar
As Variable
With aDoc
For Each aVar
In aDoc.Variables
If aVar.Name = variableName Then
ReadVars = aVar.Value
Exit Function
End If
Next
' aVar
End
With
End
Function