D
Designingsally
hi i m trying to program so that when the macros encounter some words, a
comment must be highlighted voer that particular word and inside the comment
i want some message like hi.
i tried to code that but i m getting a run-time error 5935, which says
comments, endnotes and footnotes can be added to the main story. And when i
press end- the comments are appearing with no message and the small secondary
window at the bottom of the screen is appearing having a drop down box like
author. if i click end then comments are appearing again where its been
previously appearing.
Can someone help me thru this??
Sample data is This pen is good.
Code
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.FInd.ClearFormatting
With Selection.FInd
.Text = "pen"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.FInd.Execute
Selection.FInd.ClearFormatting
With Selection.FInd
.Text = "pen"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="hi"
With Selection.FInd
.Text = "this"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.FInd.Execute
Selection.FInd.ClearFormatting
With Selection.FInd
.Text = "this"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="hi"
End Sub
I believe in Hope.
DesigningSally
comment must be highlighted voer that particular word and inside the comment
i want some message like hi.
i tried to code that but i m getting a run-time error 5935, which says
comments, endnotes and footnotes can be added to the main story. And when i
press end- the comments are appearing with no message and the small secondary
window at the bottom of the screen is appearing having a drop down box like
author. if i click end then comments are appearing again where its been
previously appearing.
Can someone help me thru this??
Sample data is This pen is good.
Code
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.FInd.ClearFormatting
With Selection.FInd
.Text = "pen"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.FInd.Execute
Selection.FInd.ClearFormatting
With Selection.FInd
.Text = "pen"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="hi"
With Selection.FInd
.Text = "this"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.FInd.Execute
Selection.FInd.ClearFormatting
With Selection.FInd
.Text = "this"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="hi"
End Sub
I believe in Hope.
DesigningSally