Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Tricia Tricia is offline
external usenet poster
 
Posts: 25
Default Find & Replace - Editing Question

Hi
With word, is there a way or an add-on that I can use for this:

When I run the spell check I want condition to change to cond.

I know you can use the find & replace, but there are some words I use a lot
and it would be a lot easier if the spell check just picked these words up
and changed them. I can't use autocorrect to do it because most of the text
I work with is copy and pasted.

Can't wait to hear what you think!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Find & Replace - Editing Question

The short answer is no. Spell check does not work like this. You can,
however do it with a macro.

Create a document with two column table containing the words to replaced in
the left column and their replacements in the right. Then save it as a
document and close it..

With your document active, run the following macro to use that table to make
the changes in your document: In the following macro, change the line

sFname = "D:\My Documents\Test\changes.doc" to reflect the name and path of
the document containing the table.

Sub ReplaceFromTableList()

Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long
Dim sFname As String

sFname = "D:\My Documents\Test\changes.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oldPart = cTable.Cell(i, 1).Range
oldPart.End = oldPart.End - 1
Set newPart = cTable.Cell(i, 2).Range
newPart.End = newPart.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oldPart, _
ReplaceWith:=newPart, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tricia wrote:
Hi
With word, is there a way or an add-on that I can use for this:

When I run the spell check I want condition to change to cond.

I know you can use the find & replace, but there are some words I use
a lot and it would be a lot easier if the spell check just picked
these words up and changed them. I can't use autocorrect to do it
because most of the text I work with is copy and pasted.

Can't wait to hear what you think!



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Janine Janine is offline
external usenet poster
 
Posts: 42
Default Find & Replace - Editing Question

Tricia,

You could also make use of autocorrect where the documents are not typed
already, say, if you type cond it stays cond and if you type condition it
becomes cond:

cond = cond
condition = cond

Of course you can use any abbreviations you like.

Janine

"Tricia" wrote in message
...
Hi
With word, is there a way or an add-on that I can use for this:

When I run the spell check I want condition to change to cond.

I know you can use the find & replace, but there are some words I use a
lot
and it would be a lot easier if the spell check just picked these words up
and changed them. I can't use autocorrect to do it because most of the
text
I work with is copy and pasted.

Can't wait to hear what you think!


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Janine Janine is offline
external usenet poster
 
Posts: 42
Default Find & Replace - Editing Question

Oops, just ignore my previous email - I missed the "autocorrect" can't
use...

"Tricia" wrote in message
...
Hi
With word, is there a way or an add-on that I can use for this:

When I run the spell check I want condition to change to cond.

I know you can use the find & replace, but there are some words I use a
lot
and it would be a lot easier if the spell check just picked these words up
and changed them. I can't use autocorrect to do it because most of the
text
I work with is copy and pasted.

Can't wait to hear what you think!


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Tricia Tricia is offline
external usenet poster
 
Posts: 25
Default Find & Replace - Editing Question


Hi Graham,

Thanks for your help, I finally have time to try it. I have no experience
with macros, but I have followed your advice, and this is exactly what I have
(see below) and it says: this command will stop the debugger and/or compile
error: Expected End Sub.

I know I have screwed it up somewhere. If you have spare time could you
please tell me what you think about it.

Tricia


Sub Macro4()
'
' Macro4 Macro
'
'
Sub ReplaceFromTableList()

Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long
Dim sFname As String

sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oldPart = cTable.Cell(i, 1).Range
oldPart.End = oldPart.End - 1
Set newPart = cTable.Cell(i, 2).Range
newPart.End = newPart.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oldPart, _
ReplaceWith:=newPart, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub





  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Find & Replace - Editing Question

Delete the line that says "Sub Macro4()"

--
Enjoy,
Tony

www.WordArticles.com

"Tricia" wrote in message
...

Hi Graham,

Thanks for your help, I finally have time to try it. I have no experience
with macros, but I have followed your advice, and this is exactly what I
have
(see below) and it says: this command will stop the debugger and/or
compile
error: Expected End Sub.

I know I have screwed it up somewhere. If you have spare time could you
please tell me what you think about it.

Tricia


Sub Macro4()
'
' Macro4 Macro
'
'
Sub ReplaceFromTableList()

Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long
Dim sFname As String

sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oldPart = cTable.Cell(i, 1).Range
oldPart.End = oldPart.End - 1
Set newPart = cTable.Cell(i, 2).Range
newPart.End = newPart.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oldPart, _
ReplaceWith:=newPart, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub




  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Tricia Tricia is offline
external usenet poster
 
Posts: 25
Default Find & Replace - Editing Question

now it doesn't like this line:
Set ChangeDoc = Documents.Open(sFname)







"Tony Jollans" wrote:

Delete the line that says "Sub Macro4()"

--
Enjoy,
Tony

www.WordArticles.com

"Tricia" wrote in message
...

Hi Graham,

Thanks for your help, I finally have time to try it. I have no experience
with macros, but I have followed your advice, and this is exactly what I
have
(see below) and it says: this command will stop the debugger and/or
compile
error: Expected End Sub.

I know I have screwed it up somewhere. If you have spare time could you
please tell me what you think about it.

Tricia


Sub Macro4()
'
' Macro4 Macro
'
'
Sub ReplaceFromTableList()

Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long
Dim sFname As String

sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oldPart = cTable.Cell(i, 1).Range
oldPart.End = oldPart.End - 1
Set newPart = cTable.Cell(i, 2).Range
newPart.End = newPart.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oldPart, _
ReplaceWith:=newPart, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub





  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Find & Replace - Editing Question

sFname is defined in the line
sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
is that path correct?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tricia wrote:
now it doesn't like this line:
Set ChangeDoc = Documents.Open(sFname)







"Tony Jollans" wrote:

Delete the line that says "Sub Macro4()"

--
Enjoy,
Tony

www.WordArticles.com

"Tricia" wrote in message
...

Hi Graham,

Thanks for your help, I finally have time to try it. I have no
experience with macros, but I have followed your advice, and this
is exactly what I have
(see below) and it says: this command will stop the debugger and/or
compile
error: Expected End Sub.

I know I have screwed it up somewhere. If you have spare time
could you please tell me what you think about it.

Tricia


Sub Macro4()
'
' Macro4 Macro
'
'
Sub ReplaceFromTableList()

Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long
Dim sFname As String

sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oldPart = cTable.Cell(i, 1).Range
oldPart.End = oldPart.End - 1
Set newPart = cTable.Cell(i, 2).Range
newPart.End = newPart.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oldPart, _
ReplaceWith:=newPart, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub



  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Tricia Tricia is offline
external usenet poster
 
Posts: 25
Default Find & Replace - Editing Question

SUCCESS!! Thankyou your the best

The problem was: the document was not saved as 'doc' it was saved as 'docx'



"Graham Mayor" wrote:

sFname is defined in the line
sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
is that path correct?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tricia wrote:
now it doesn't like this line:
Set ChangeDoc = Documents.Open(sFname)







"Tony Jollans" wrote:

Delete the line that says "Sub Macro4()"

--
Enjoy,
Tony

www.WordArticles.com

"Tricia" wrote in message
...

Hi Graham,

Thanks for your help, I finally have time to try it. I have no
experience with macros, but I have followed your advice, and this
is exactly what I have
(see below) and it says: this command will stop the debugger and/or
compile
error: Expected End Sub.

I know I have screwed it up somewhere. If you have spare time
could you please tell me what you think about it.

Tricia


Sub Macro4()
'
' Macro4 Macro
'
'
Sub ReplaceFromTableList()

Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long
Dim sFname As String

sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oldPart = cTable.Cell(i, 1).Range
oldPart.End = oldPart.End - 1
Set newPart = cTable.Cell(i, 2).Range
newPart.End = newPart.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oldPart, _
ReplaceWith:=newPart, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub




  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Find & Replace - Editing Question

You are welcome

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tricia wrote:
SUCCESS!! Thankyou your the best

The problem was: the document was not saved as 'doc' it was saved as
'docx'



"Graham Mayor" wrote:

sFname is defined in the line
sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
is that path correct?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tricia wrote:
now it doesn't like this line:
Set ChangeDoc = Documents.Open(sFname)







"Tony Jollans" wrote:

Delete the line that says "Sub Macro4()"

--
Enjoy,
Tony

www.WordArticles.com

"Tricia" wrote in message
...

Hi Graham,

Thanks for your help, I finally have time to try it. I have no
experience with macros, but I have followed your advice, and this
is exactly what I have
(see below) and it says: this command will stop the debugger
and/or compile
error: Expected End Sub.

I know I have screwed it up somewhere. If you have spare time
could you please tell me what you think about it.

Tricia


Sub Macro4()
'
' Macro4 Macro
'
'
Sub ReplaceFromTableList()

Dim ChangeDoc As Document, RefDoc As Document
Dim cTable As Table
Dim oldPart As Range, newPart As Range
Dim i As Long
Dim sFname As String

sFname = "C:\Users\Tricia\Documents\TraderMacro.doc"
Set RefDoc = ActiveDocument
Set ChangeDoc = Documents.Open(sFname)
Set cTable = ChangeDoc.Tables(1)
RefDoc.Activate
For i = 1 To cTable.Rows.Count
Set oldPart = cTable.Cell(i, 1).Range
oldPart.End = oldPart.End - 1
Set newPart = cTable.Cell(i, 2).Range
newPart.End = newPart.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oldPart, _
ReplaceWith:=newPart, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ChangeDoc.Close wdDoNotSaveChanges
End Sub



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace question jezzica85 Microsoft Word Help 2 June 21st 07 04:51 AM
Find & Replace Question Siuan New Users 2 August 12th 06 08:59 PM
Find & Replace Question Fuzzhead Microsoft Word Help 4 May 6th 06 12:07 AM
Find and Replace question z3365 Microsoft Word Help 4 February 22nd 06 11:09 PM
--A Find & Replace Question-- KlikThis Microsoft Word Help 3 January 1st 05 05:58 PM


All times are GMT +1. The time now is 04:18 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"