Ann_BBO
11-16-2009, 11:51 PM
Hi All,
I would like to search the text which contains ".doc" (e.g. Verison1.doc) in WORD File and then copy to Excel File. I have record the marco in WORD first and then modify the code in EXCEl marco. However, in my code, it has error in "wdCharacter".
Set wdRng = wdApp.Selection
'Find the Version Number in Doc
wdRng.Find.ClearFormatting
wdRng.Find.Text = ".doc"
wdRng.Find.Forward = True
wdRng.Find.Execute
wdRng.MoveRight Unit:=wdCharacter, count:=1
wdRng.MoveLeft Unit:=wdCharacter, count:=1, Extend:=wdExtend
wdRng.Selection.Copy
Thanks&Regards,
Ann
I would like to search the text which contains ".doc" (e.g. Verison1.doc) in WORD File and then copy to Excel File. I have record the marco in WORD first and then modify the code in EXCEl marco. However, in my code, it has error in "wdCharacter".
Set wdRng = wdApp.Selection
'Find the Version Number in Doc
wdRng.Find.ClearFormatting
wdRng.Find.Text = ".doc"
wdRng.Find.Forward = True
wdRng.Find.Execute
wdRng.MoveRight Unit:=wdCharacter, count:=1
wdRng.MoveLeft Unit:=wdCharacter, count:=1, Extend:=wdExtend
wdRng.Selection.Copy
Thanks&Regards,
Ann