G
Guest
Wow MS word can sure drive a person crazy sometimes. Is there any way to
stop it from trying to 'help' me? What I am doing is creating a macro that
will paste text and do a simple find and replace. When I do it manually it
works fine, even when I record the macro. However when I run the macro,
instead of unformatted text, I get a table! I didn't say anything in the
macro about a table and I don't want it.
One thing I notice is that after doing a Paste Special -> Unformatted text
Word seems to call this wdPasteDefault. What is going on and why won't Word
just do as I ask it to and no more?
Thanks for any help I may recieve
Sub Try3_to_paste_and_format()
'
' Try3_to_paste_and_format Macro
' Macro recorded 20/04/2005 by me
'
Selection.PasteAndFormat (wdPasteDefault)
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^t"
.Replacement.Text = ","
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
stop it from trying to 'help' me? What I am doing is creating a macro that
will paste text and do a simple find and replace. When I do it manually it
works fine, even when I record the macro. However when I run the macro,
instead of unformatted text, I get a table! I didn't say anything in the
macro about a table and I don't want it.
One thing I notice is that after doing a Paste Special -> Unformatted text
Word seems to call this wdPasteDefault. What is going on and why won't Word
just do as I ask it to and no more?
Thanks for any help I may recieve
Sub Try3_to_paste_and_format()
'
' Try3_to_paste_and_format Macro
' Macro recorded 20/04/2005 by me
'
Selection.PasteAndFormat (wdPasteDefault)
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^t"
.Replacement.Text = ","
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub