<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Replacing Text with VBA - Part 2: Complex Structures</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22488/replacing-text-with-vba-part-2-complex-structures</link><description>Bentley View, MicroStation, PowerDraft</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Replacing Text with VBA - Part 2: Complex Structures</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22488/replacing-text-with-vba-part-2-complex-structures</link><pubDate>Tue, 16 Feb 2016 09:28:34 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:017c8eae-3a17-4c9a-b9c3-be49f8586d0a</guid><dc:creator>Carl Myhill</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22488/replacing-text-with-vba-part-2-complex-structures#comments</comments><description>Current Revision posted to MicroStation Wiki by Carl Myhill on 2/16/2016 9:28:34 AM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img width="189" height="60" style="border-width:0px;" alt=" " src="http://communities.bentley.com/cfs-file.ashx/__key/communityserver-components-sitefiles/TSG-Logo.png" /&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;table style="width:500px;background-color:#dce5f0;border:#dce5f0 0px solid;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;span style="font-size:medium;"&gt;&lt;b&gt;Applies To&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MicroStation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.09.578&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Windows 7 32 bit,Windows 7 64 bit&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Programming&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VBA&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Original Author:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tristan Anderson, Bentley Technical Support Group&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;strong&gt;&lt;span style="font-size:large;"&gt;Background Information&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this second part, the functionality will be expanded. The text elements that have been placed directly in the active model and those who are in text nodes and cells of any depth will be checked.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:large;"&gt;Steps&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To carry out the investigation of nested cells, I have created a subroutine called &lt;em&gt;Complex Search&lt;/em&gt;. This is a recursive subroutine used for the iteration of the cells.&lt;/p&gt;
&lt;p&gt;In addition, further call parameters are supported, where you can indicate whether or not the replcaement should be performed in the complex elements. With no parameter, this subroutine simply functions the same as the example in the first part with one exception. Text nodes are no processed without the option used.&lt;/p&gt;
&lt;p&gt;Here is an example of how to do this:&lt;/p&gt;
&lt;div class="line number1 index0 alt2" style="background:white;text-transform:none;color:#000000;text-align:left;margin:0px;letter-spacing:normal;text-indent:0px;border:0px;"&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Option Explicit
    &amp;#39; Searches in text strings and nested cells
 
    Private sToFind As String       &amp;#39; Find text
    Private sToReplace As String    &amp;#39; Replace with this text
    Private isComplex As Boolean
 
Sub TxtRep_complex()
    Dim CmdLine() As String
    Dim Ee As ElementEnumerator
    Dim Sc As New ElementScanCriteria
 
    &amp;#39; As a separator between parameters, &amp;quot;|&amp;quot; is used.
    CmdLine = Split(KeyinArguments, &amp;quot;|&amp;quot;)
    &amp;#39; Cancel if incorrect parameters are given:
    If UBound(CmdLine) &amp;lt; 1 Then  &amp;#39; no parameter given
        MessageCenter.AddMessage &amp;quot;Replace Text: Missing Parameters, see details:&amp;quot;, &amp;quot;Call was made with: &amp;quot; + KeyinArguments, msdMessageCenterPriorityError
        Exit Sub
    End If
     
    sToFind = Trim(CmdLine(0))      &amp;#39;1. Parameter for search text
    sToReplace = Trim(CmdLine(1))   &amp;#39;2. Parameter for new text     
    &amp;#39; Check if optional parameter = yes complex was given
    isComplex = False
    If UBound(CmdLine) &amp;gt; 1 Then
        If InStr(CmdLine(2), &amp;quot;complex&amp;quot;) &amp;gt; 0 And InStr(CmdLine(2), &amp;quot;yes&amp;quot;) &amp;gt; 0 Then isComplex = True
    End If
     
    &amp;#39; If not looking at cells, only filter texts and text nodes:
    If isComplex = False Then
        Sc.ExcludeAllTypes
        Sc.IncludeType msdElementTypeText
        Sc.IncludeType msdElementTypeTextNode   &amp;#39; Also text node always search
    Else
        Sc.ExcludeNonGraphical
    End If
     
    Set Ee = ActiveModelReference.Scan(Sc)
    &amp;#39; Browse current model and start the test routine:
    Do While Ee.MoveNext
        Call complexSearch(Ee.Current)
    Loop
End Sub
&amp;#39; Subroutine for recursively browsing nested complex elements
Sub complexSearch(oEle As Element)
    Dim EeSub As ElementEnumerator
    &amp;#39; If a complex element or text node is found, check all sub-elements:
    If (oEle.IsComplexElement And isComplex) Or (oEle.Type = msdElementTypeTextNode) Then
        Set EeSub = oEle.AsComplexElement.GetSubElements
        Do While EeSub.MoveNext
            Call complexSearch(EeSub.Current)
        Loop
    &amp;#39; Otherwise string compare, if a text is present:
    Else
        If oEle.Type = msdElementTypeText Then
            If oEle.AsTextElement.Text = sToFind Then
               oEle.AsTextElement.Text = sToReplace
               oEle.Rewrite
            End If
        End If
    End If
End Sub&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The call is made in this example about the subroutine TxtRep_complex, which can be called as in the previous example with 2 parameters:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p align="left"&gt;&lt;em&gt;vba run TxtRep_complex Findtext&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p align="left" dir="ltr"&gt;The optional parameter Complex = yes specifies whether you want to search for text in the complex structures or not:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p align="left" dir="ltr"&gt;&lt;em&gt;vba run TxtRep_complex&amp;nbsp;Findtext | Replacetext | [complex=yes]&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p align="left" dir="ltr"&gt;These 3 variables:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Private sToFind As String &amp;#39; Find Text to replace
Private sToReplace As String &amp;#39; Replace found text with this
Private isComplex As Boolean&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p align="left" dir="ltr"&gt;have been declared outside the routine as private, so they are valid in all routines of this module and do not need to be entered when calling routines as parameters.&lt;/p&gt;
&lt;p align="center" dir="ltr"&gt;&lt;a href="http://communities.bentley.com/products/microstation/w/microstation__wiki/22463.replacing-text-with-vba-part-1-introduction"&gt;&amp;lt;&amp;lt; RETURN TO PART 1 &amp;lt;&amp;lt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: VBAWindows 7 32 bit, MicroStation, Windows 7 64 bit, Programming, en, 08.11.09.578, SELECTsupport&lt;/div&gt;
</description></item><item><title>Replacing Text with VBA - Part 2: Complex Structures</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22488/replacing-text-with-vba-part-2-complex-structures/revision/2</link><pubDate>Fri, 10 Jul 2015 14:47:27 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:017c8eae-3a17-4c9a-b9c3-be49f8586d0a</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22488/replacing-text-with-vba-part-2-complex-structures#comments</comments><description>Revision 2 posted to MicroStation Wiki by Tristan Anderson on 7/10/2015 2:47:27 PM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img style="border-width:0px;" alt=" " src="http://communities.bentley.com/cfs-file.ashx/__key/communityserver-components-sitefiles/TSG-Logo.png" width="189" height="60" /&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;table style="width:500px;background-color:#dce5f0;border:#dce5f0 0px solid;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;span style="font-size:medium;"&gt;&lt;b&gt;Applies To&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MicroStation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.09.578&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Windows 7 32 bit,Windows 7 64 bit&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Programming&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VBA&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Original Author:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tristan Anderson, Bentley Technical Support Group&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;strong&gt;&lt;span style="font-size:large;"&gt;Background Information&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this second part, the functionality will be expanded. The text eloements that have been placed directly in the active model and those who are in text nodes and cells of any depth will be checked.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:large;"&gt;Steps&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To carry out the investigation of nested cells, I have created a subroutine called &lt;em&gt;Complex Search&lt;/em&gt;. This is a recursive subroutine used for the iteration of the cells.&lt;/p&gt;
&lt;p&gt;In addition, further call parameters are supported, where you can indicate whether or not the replcaement should be performed in the complex elements. With no parameter, this subroutine simply functions the same as the example in the first part with one exception. Text nodes are no processed without the option used.&lt;/p&gt;
&lt;p&gt;Here is an example of how to do this:&lt;/p&gt;
&lt;div class="line number1 index0 alt2" style="background:white;text-transform:none;color:#000000;text-align:left;margin:0px;letter-spacing:normal;text-indent:0px;border:0px;"&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Option Explicit
    &amp;#39; Searches in text strings and nested cells
 
    Private sToFind As String       &amp;#39; Find text
    Private sToReplace As String    &amp;#39; Replace with this text
    Private isComplex As Boolean
 
Sub TxtRep_complex()
    Dim CmdLine() As String
    Dim Ee As ElementEnumerator
    Dim Sc As New ElementScanCriteria
 
    &amp;#39; As a separator between parameters, &amp;quot;|&amp;quot; is used.
    CmdLine = Split(KeyinArguments, &amp;quot;|&amp;quot;)
    &amp;#39; Cancel if incorrect parameters are given:
    If UBound(CmdLine) &amp;lt; 1 Then  &amp;#39; no parameter given
        MessageCenter.AddMessage &amp;quot;Replace Text: Missing Parameters, see details:&amp;quot;, &amp;quot;Call was made with: &amp;quot; + KeyinArguments, msdMessageCenterPriorityError
        Exit Sub
    End If
     
    sToFind = Trim(CmdLine(0))      &amp;#39;1. Parameter for search text
    sToReplace = Trim(CmdLine(1))   &amp;#39;2. Parameter for new text     
    &amp;#39; Check if optional parameter = yes complex was given
    isComplex = False
    If UBound(CmdLine) &amp;gt; 1 Then
        If InStr(CmdLine(2), &amp;quot;complex&amp;quot;) &amp;gt; 0 And InStr(CmdLine(2), &amp;quot;yes&amp;quot;) &amp;gt; 0 Then isComplex = True
    End If
     
    &amp;#39; If not looking at cells, only filter texts and text nodes:
    If isComplex = False Then
        Sc.ExcludeAllTypes
        Sc.IncludeType msdElementTypeText
        Sc.IncludeType msdElementTypeTextNode   &amp;#39; Also text node always search
    Else
        Sc.ExcludeNonGraphical
    End If
     
    Set Ee = ActiveModelReference.Scan(Sc)
    &amp;#39; Browse current model and start the test routine:
    Do While Ee.MoveNext
        Call complexSearch(Ee.Current)
    Loop
End Sub
&amp;#39; Subroutine for recursively browsing nested complex elements
Sub complexSearch(oEle As Element)
    Dim EeSub As ElementEnumerator
    &amp;#39; If a complex element or text node is found, check all sub-elements:
    If (oEle.IsComplexElement And isComplex) Or (oEle.Type = msdElementTypeTextNode) Then
        Set EeSub = oEle.AsComplexElement.GetSubElements
        Do While EeSub.MoveNext
            Call complexSearch(EeSub.Current)
        Loop
    &amp;#39; Otherwise string compare, if a text is present:
    Else
        If oEle.Type = msdElementTypeText Then
            If oEle.AsTextElement.Text = sToFind Then
               oEle.AsTextElement.Text = sToReplace
               oEle.Rewrite
            End If
        End If
    End If
End Sub&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The call is made in this example about the subroutine TxtRep_complex, which can be called as in the previous example with 2 parameters:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p align="left"&gt;&lt;em&gt;vba run TxtRep_complex Findtext&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr" align="left"&gt;The optional parameter Complex = yes specifies whether you want to search for text in the complex structures or not:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p dir="ltr" align="left"&gt;&lt;em&gt;vba run TxtRep_complex&amp;nbsp;Findtext | Replacetext | [complex=yes]&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr" align="left"&gt;These 3 variables:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Private sToFind As String &amp;#39; Find Text to replace
Private sToReplace As String &amp;#39; Replace found text with this
Private isComplex As Boolean&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr" align="left"&gt;have been declared outside the routine as private, so they are valid in all routines of this module and do not need to be entered when calling routines as parameters.&lt;/p&gt;
&lt;p dir="ltr" align="center"&gt;&lt;a href="http://communities.bentley.com/products/microstation/w/microstation__wiki/22463.replacing-text-with-vba-part-1-introduction"&gt;&amp;lt;&amp;lt; RETURN TO PART 1 &amp;lt;&amp;lt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: VBAWindows 7 32 bit, MicroStation, Windows 7 64 bit, Programming, en, 08.11.09.578, SELECTsupport&lt;/div&gt;
</description></item><item><title>Replacing Text with VBA - Part 2: Complex Structures</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22488/replacing-text-with-vba-part-2-complex-structures/revision/1</link><pubDate>Fri, 10 Jul 2015 14:46:03 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:017c8eae-3a17-4c9a-b9c3-be49f8586d0a</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22488/replacing-text-with-vba-part-2-complex-structures#comments</comments><description>Revision 1 posted to MicroStation Wiki by Tristan Anderson on 7/10/2015 2:46:03 PM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;border-top-width:0px;" alt=" " src="http://communities.bentley.com/cfs-file.ashx/__key/communityserver-components-sitefiles/TSG-Logo.png" width="189" height="60" /&gt;&lt;/b&gt;&lt;/h1&gt;
&lt;table style="border-top:#dce5f0 0px solid;border-right:#dce5f0 0px solid;width:500px;border-bottom:#dce5f0 0px solid;border-left:#dce5f0 0px solid;background-color:#dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;span style="font-size:medium;"&gt;&lt;b&gt;Applies To&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MicroStation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.09.578 &lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Windows 7 32 bit,Windows 7 64 bit&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Programming&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VBA&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Original Author:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tristan Anderson, Bentley Technical Support Group&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;strong&gt;&lt;font size="4"&gt;Background Information&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this second part, the functionality will be expanded. The text eloements that have been placed directly in the active model and those who are in text nodes and cells of any depth will be checked.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Steps&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To carry out the investigation of nested cells, I have created a subroutine called &lt;em&gt;Complex Search&lt;/em&gt;. This is a recursive subroutine used for the iteration of the cells.&lt;/p&gt;
&lt;p&gt;In addition, further call parameters are supported, where you can indicate whether or not the replcaement should be performed in the complex elements. With no parameter, this subroutine simply functions the same as the example in the first part with one exception. Text nodes are no processed without the option used.&lt;/p&gt;
&lt;p&gt;Here is an example of how to do this:&lt;/p&gt;
&lt;div class="line number1 index0 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Option&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Explicit&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number2 index1 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Searches in text strings and nested cells&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number3 index2 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number4 index3 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Private&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;sToFind &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;String&lt;/code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Find text&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number5 index4 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Private&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;sToReplace &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;String&lt;/code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Replace with this text&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number6 index5 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Private&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;isComplex &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Boolean&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number7 index6 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number8 index7 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sub&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;TxtRep_complex()&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number9 index8 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Dim&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;CmdLine() &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;String&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number10 index9 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Dim&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Ee &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ElementEnumerator&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number11 index10 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Dim&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sc &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;New&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ElementScanCriteria&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number12 index11 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number13 index12 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; As a separator between parameters, &amp;quot;|&amp;quot; is used.&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number14 index13 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;CmdLine = Split(KeyinArguments, &lt;/code&gt;&lt;code class="vb string" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;quot;|&amp;quot;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;)&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number15 index14 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Cancel if incorrect parameters are given:&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number16 index15 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;UBound(CmdLine) &amp;lt; 1 &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt;&amp;nbsp; &lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; no parameter given&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number17 index16 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;MessageCenter.AddMessage &lt;/code&gt;&lt;code class="vb string" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;quot;Replace Text: Missing Parameters, see details:&amp;quot;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;, &lt;/code&gt;&lt;code class="vb string" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;quot;Call was made with: &amp;quot;&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;+ KeyinArguments, msdMessageCenterPriorityError&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number18 index17 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Exit&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sub&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number19 index18 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number20 index19 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number21 index20 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;sToFind = Trim(CmdLine(0))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39;1. Parameter for search text &lt;/code&gt;&lt;/div&gt;
&lt;div class="line number22 index21 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;sToReplace = Trim(CmdLine(1))&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39;2. Parameter&amp;nbsp;for new text&lt;/code&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number24 index23 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Check if optional parameter = yes complex was given&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number24 index23 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&lt;/code&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;isComplex = &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;False&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number26 index25 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;UBound(CmdLine) &amp;gt; 1 &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number27 index26 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;InStr(CmdLine(2), &lt;/code&gt;&lt;code class="vb string" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;quot;complex&amp;quot;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;) &amp;gt; 0 &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;And&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;InStr(CmdLine(2), &lt;/code&gt;&lt;code class="vb string" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;quot;yes&amp;quot;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;) &amp;gt; 0 &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;isComplex = &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;True&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number28 index27 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number29 index28 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number30 index29 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; If not looking at cells, only filter texts and text nodes:&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number31 index30 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;isComplex = &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;False&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number32 index31 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sc.ExcludeAllTypes&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number33 index32 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sc.IncludeType msdElementTypeText&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number34 index33 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sc.IncludeType msdElementTypeTextNode&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Also text node always search &lt;/code&gt;&lt;/div&gt;
&lt;div class="line number35 index34 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Else&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number36 index35 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sc.ExcludeNonGraphical&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number37 index36 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number38 index37 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="line number39 index38 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Set&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Ee = ActiveModelReference.Scan(Sc)&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number40 index39 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008200"&gt;&amp;#39; Browse current model and start the test routine&lt;/font&gt;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;:&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number41 index40 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Do&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;While&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Ee.MoveNext&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number42 index41 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Call&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;complexSearch(Ee.Current)&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number43 index42 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Loop&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number44 index43 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sub&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number45 index44 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Subroutine for recursively browsing nested complex elements&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number46 index45 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sub&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;complexSearch(oEle &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Element)&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number47 index46 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Dim&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;EeSub &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;As&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;ElementEnumerator&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number48 index47 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; If a complex element or text node is found, check all sub-elements:&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number49 index48 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;(oEle.IsComplexElement &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;And&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;isComplex) &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Or&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;(oEle.Type = msdElementTypeTextNode) &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number50 index49 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Set&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;EeSub = oEle.AsComplexElement.GetSubElements&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number51 index50 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Do&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;While&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;EeSub.MoveNext&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number52 index51 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Call&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;complexSearch(EeSub.Current)&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number53 index52 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Loop&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number54 index53 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb comments" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;#39; Otherwise string compare, if a text is present:&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number55 index54 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Else&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number56 index55 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;oEle.Type = msdElementTypeText &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number57 index56 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt; &lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;oEle.AsTextElement.Text = sToFind &lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Then&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number58 index57 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;oEle.AsTextElement.Text = sToReplace&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number59 index58 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb plain" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;oEle.Rewrite&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number60 index59 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number61 index60 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number62 index61 alt1" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb spaces" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;If&lt;/code&gt;&lt;/div&gt;
&lt;div class="line number63 index62 alt2" style="border-top:0px;border-right:0px;background:white;border-bottom:0px;text-transform:none;color:rgb(0,0,0);text-align:left;margin:0px;border-left:0px;letter-spacing:normal;text-indent:0px;"&gt;&lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;End&lt;/code&gt; &lt;code class="vb keyword" style="border-top:0px;border-right:0px;background:none transparent scroll repeat 0% 0%;border-bottom:0px;margin:0px;border-left:0px;"&gt;Sub&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;The call is made in this example about the subroutine TxtRep_complex, which can be called as in the previous example with 2 parameters:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p align="left"&gt;&lt;em&gt;vba run TxtRep_complex Findtext&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr" align="left"&gt;The optional parameter Complex = yes specifies whether you want to search for text in the complex structures or not:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p dir="ltr" align="left"&gt;&lt;em&gt;vba run TxtRep_complex&amp;nbsp;Findtext | Replacetext | [complex=yes]&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr" align="left"&gt;These 3 variables:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p dir="ltr" align="left"&gt;Private sToFind As String &amp;#39; Find Text to replace &lt;/p&gt;
&lt;p dir="ltr" align="left"&gt;Private sToReplace As String &amp;#39; Replace found text with this&lt;/p&gt;
&lt;p dir="ltr" align="left"&gt;Private isComplex As Boolean&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr" align="left"&gt;have been declared outside the routine as private, so they are valid in all routines of this module and do not need to be entered when calling routines as parameters.&lt;/p&gt;
&lt;p dir="ltr" align="center"&gt;&lt;a href="http://communities.bentley.com/products/microstation/w/microstation__wiki/22463.replacing-text-with-vba-part-1-introduction"&gt;&amp;lt;&amp;lt; RETURN TO PART 1 &amp;lt;&amp;lt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: VBAWindows 7 32 bit, MicroStation, Windows 7 64 bit, Programming, en, 08.11.09.578, SELECTsupport&lt;/div&gt;
</description></item></channel></rss>