J
John Doue
Hi,
Can anyone help me find what the problem is with this autoopen macro
that works perfectly in Word 03 but has a problem in 97? When there is
hidden text in the document being opened, I do get the desired warning,
but the whole text appears black, to return to normal after the warning
has been acknowledged. When there are both comments and hidden text, the
problem does not exist.
Thanks a lot, I am stumped!
Sub autoopen()
'
' autoopen Macro
' Macro recorded 09/26/99 by John
If ActiveDocument.comments.Count > 0 Then
With ActiveDocument
i = .comments.Count
End With
Call MsgBox("There are " & i & " Comments in the document")
End If
Dim oRg As Range
Set oRg = ActiveDocument.Range
ActiveWindow.View.ShowHiddenText = True
With oRg.Find
.Format = True
.Forward = True
.Font.Hidden = True
If .Execute Then
oRg.Select
With ActiveWindow.View
.ShowHiddenText = True
.ShowAll = True
End With
Call MsgBox ("Hidden text!")
Else
ActiveWindow.View.ShowHiddenText = False
End If
End With
With Options
.ReplaceSelection = True
.AllowDragAndDrop = True
.AutoWordSelection = False
.INSKeyForPaste = False
.SmartCutPaste = True
.AllowAccentedUppercase = False
.PictureEditor = "Microsoft Word"
.TabIndentKey = True
.Overtype = False
End With
If ActiveDocument.Bookmarks.Exists("Lastedit") = True Then
ActiveDocument.Bookmarks("Lastedit").Select
Selection.GoTo What:=wdGoToBookmark, Name:="Lastedit"
N = sndPlaySound("E:\WAVEFILES\Attn.wav", 0)
ActiveDocument.Bookmarks("Lastedit").Delete
End If
CommandBars("Reviewing").Visible = False
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayVerticalRuler = True
.DisplayScreenTips = False
With .View
.ShowAnimation = True
.ShowPicturePlaceHolders = False
.ShowFieldCodes = False
.ShowBookmarks = False
.FieldShading = wdFieldShadingAlways
.ShowTabs = False
.ShowSpaces = False
.ShowParagraphs = False
.ShowHyphens = False
.ShowHiddenText = False
.ShowAll = False
.ShowDrawings = True
.ShowObjectAnchors = True
.ShowTextBoundaries = False
.ShowHighlight = True
End With
End With
End Sub
Can anyone help me find what the problem is with this autoopen macro
that works perfectly in Word 03 but has a problem in 97? When there is
hidden text in the document being opened, I do get the desired warning,
but the whole text appears black, to return to normal after the warning
has been acknowledged. When there are both comments and hidden text, the
problem does not exist.
Thanks a lot, I am stumped!
Sub autoopen()
'
' autoopen Macro
' Macro recorded 09/26/99 by John
If ActiveDocument.comments.Count > 0 Then
With ActiveDocument
i = .comments.Count
End With
Call MsgBox("There are " & i & " Comments in the document")
End If
Dim oRg As Range
Set oRg = ActiveDocument.Range
ActiveWindow.View.ShowHiddenText = True
With oRg.Find
.Format = True
.Forward = True
.Font.Hidden = True
If .Execute Then
oRg.Select
With ActiveWindow.View
.ShowHiddenText = True
.ShowAll = True
End With
Call MsgBox ("Hidden text!")
Else
ActiveWindow.View.ShowHiddenText = False
End If
End With
With Options
.ReplaceSelection = True
.AllowDragAndDrop = True
.AutoWordSelection = False
.INSKeyForPaste = False
.SmartCutPaste = True
.AllowAccentedUppercase = False
.PictureEditor = "Microsoft Word"
.TabIndentKey = True
.Overtype = False
End With
If ActiveDocument.Bookmarks.Exists("Lastedit") = True Then
ActiveDocument.Bookmarks("Lastedit").Select
Selection.GoTo What:=wdGoToBookmark, Name:="Lastedit"
N = sndPlaySound("E:\WAVEFILES\Attn.wav", 0)
ActiveDocument.Bookmarks("Lastedit").Delete
End If
CommandBars("Reviewing").Visible = False
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayVerticalRuler = True
.DisplayScreenTips = False
With .View
.ShowAnimation = True
.ShowPicturePlaceHolders = False
.ShowFieldCodes = False
.ShowBookmarks = False
.FieldShading = wdFieldShadingAlways
.ShowTabs = False
.ShowSpaces = False
.ShowParagraphs = False
.ShowHyphens = False
.ShowHiddenText = False
.ShowAll = False
.ShowDrawings = True
.ShowObjectAnchors = True
.ShowTextBoundaries = False
.ShowHighlight = True
End With
End With
End Sub