S
senthil
Hello,
I use VBScript Regular expression (VBScript.dll\3)
for 'pattern matching and replacements' concepts in
my "Word to XML" tool.
the code...
Function RExpReplace(ptrn As String, Sstr As String, rStr
As String, iCase As Boolean, gCase As Boolean) As String
Set regEx = New RegExp ' Create regular
expression.
regEx.Pattern = ptrn ' Set pattern.
regEx.IgnoreCase = iCase ' Set case sensitivity.
regEx.Global = gCase ' Set Global search
regEx.MultiLine = True
RExpReplace = regEx.Replace(Sstr, rStr) ' Make
replacement.
End Function
On my machine this function works fine. But with other
machines, it invoke the following error..
Automation error
The object invoked has disconnected from its clients.
Its works fine, when i changed the code in debug mode, by
using breakpoint at 'RExpReplace = regEx.Replace(Sstr,
rStr)'
the code...
Dim temp as String
temp = regEx.Replace(Sstr, rStr) ' Make replacement.
RExpReplace = temp
I find, Microsoft Knowledge Base Article - 813120 relates
to my problem, but not exactly.
please let me know where is the problem.
regards,
senthil
I use VBScript Regular expression (VBScript.dll\3)
for 'pattern matching and replacements' concepts in
my "Word to XML" tool.
the code...
Function RExpReplace(ptrn As String, Sstr As String, rStr
As String, iCase As Boolean, gCase As Boolean) As String
Set regEx = New RegExp ' Create regular
expression.
regEx.Pattern = ptrn ' Set pattern.
regEx.IgnoreCase = iCase ' Set case sensitivity.
regEx.Global = gCase ' Set Global search
regEx.MultiLine = True
RExpReplace = regEx.Replace(Sstr, rStr) ' Make
replacement.
End Function
On my machine this function works fine. But with other
machines, it invoke the following error..
Automation error
The object invoked has disconnected from its clients.
Its works fine, when i changed the code in debug mode, by
using breakpoint at 'RExpReplace = regEx.Replace(Sstr,
rStr)'
the code...
Dim temp as String
temp = regEx.Replace(Sstr, rStr) ' Make replacement.
RExpReplace = temp
I find, Microsoft Knowledge Base Article - 813120 relates
to my problem, but not exactly.
please let me know where is the problem.
regards,
senthil