Hi people,

I have a small syntactical issue

I have outdated components list with me in a word document and i am using a small Wild card Replacement for that

Example When i do it manually ...i press find and replace and type this

---Text in document----

[Unit Name]=Carbide Grade A: K1[Internal]
[Unit Name]=Carbide Grade B: K3[Internal] and so on

i need to find the string [Unit Name]=Carbide Grade A: K1[Internal]
and replace it with [CAK1] and similarly i need to find
[Unit Name]=Carbide Grade B: K3[External] and replace it with CBK3

Manually i do it but typing this in the Find box
Unit Name=*Carbide*K1[Internal] and replace it with CAK1

But since my list is huge and there are lots of documents i am trying to make it automatic here's my code

VB Code:
  1. Function replwc(source As String, str_search As String, dest As String)
  2.     Selection.Find.ClearFormatting
  3.     Selection.Find.Replacement.ClearFormatting
  4.     With Selection.Find
  5.         .MatchWildcards = True
  6.         .Text = \[\Unit Name=* & source & * & str_search & \[\Internal\]
  7.         .Replacement.Text = dest
  8.         .Forward = True
  9.         .Wrap = wdFindContinue
  10.         .Format = False
  11.         .MatchCase = False
  12.         .MatchWholeWord = False
  13.         .MatchWildcards = True
  14.         .MatchSoundsLike = False
  15.         .MatchAllWordForms = False
  16.     End With
  17.     Selection.Find.Execute Replace:=wdReplaceAll
  18. End Function
  19.  
  20.  
  21. Sub FrepWC()
  22. s = replwc("Carbide Grade A", "K1", "CAK1")
  23. s = replwc("Carbide Grade A", "K3", "CAK3")
  24. s = replwc("Carbide Grade B", "Q1", "CBQ1")
  25. s = replwc("Carbide Grade C", "R1", "CBR1")
  26. End Sub
I am getting a error on line
VB Code:
  1. .Text = \[\Carbide Grade A* & source & * & str_search & \[\Internal\]

How can i get this to work??