<?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 1: Introduction</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22463/replacing-text-with-vba-part-1-introduction</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 1: Introduction</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22463/replacing-text-with-vba-part-1-introduction</link><pubDate>Fri, 10 Jul 2015 14:48:07 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:00eb74e4-d458-4aa0-862e-4735db1f5ebc</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22463/replacing-text-with-vba-part-1-introduction#comments</comments><description>Current Revision posted to MicroStation Wiki by Tristan Anderson on 7/10/2015 2:48:07 PM&lt;br /&gt;
&lt;h1&gt;&lt;b&gt;&lt;img style="border-width:0px;" alt=" " src="/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;&lt;strong&gt;&lt;span style="font-size:large;"&gt;Background Information&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The existing MicroStation functionality to search and replace features many options and variations. However, there are always cases in which a considerable effort has to be taken when larger inventories need to be changed, and at the same time a number of replacements have to be made. This short series of examples will address different problems that may arise in this matter. I will start with a simple example and add some more options later to cover many aspects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Simple Example for Substituting it by text in the current model&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following example searches the active model and searches for text that has been given as the first parameter when starting up the VBA routine. When this text is found, it is replaced by the text that was passed as the second parameter.I use the pipe character &amp;quot;|&amp;quot; as a delimiter when calling to separate the&amp;nbsp; parameters cleanly.&lt;/p&gt;
&lt;p&gt;Here is an example of how this can be done:&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;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
Sub TxtRep_simple()
Dim sToFind As String       &amp;#39; Find the text
Dim sToReplace As String    &amp;#39; Replace with this text
Dim CmdLine() As String
Dim Ee As ElementEnumerator
Dim Sc As New ElementScanCriteria
 
&amp;#39; As a separator between parameters, use &amp;quot;|&amp;quot;
CmdLine = Split(KeyinArguments, &amp;quot;|&amp;quot;)
&amp;#39; Cancel if incorrect parameters were given:
If UBound(CmdLine) &amp;lt;&amp;gt; 1 Then  &amp;#39; given the wrong parameter
    MessageCenter.AddMessage &amp;quot;Replace text: incorrect parameters were given, 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 - text to search
sToReplace = Trim(CmdLine(1))   &amp;#39;2.Parameter - new text
 
&amp;#39; Browse current model based on texts and examine
Sc.ExcludeAllTypes
Sc.IncludeType msdElementTypeText
Set Ee = ActiveModelReference.Scan(Sc)
Do While Ee.MoveNext
    With Ee.Current.AsTextElement
        If .Text = sToFind Then
            .Text = sToReplace
            .Rewrite
        End If
    End With
Loop
End Sub&lt;/pre&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When this routine is loaded, it can be started using the following syntax:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p&gt;&lt;em&gt;vba run TxtRep_simple findtext | replacetext&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;It searches for the &amp;quot;findtext&amp;quot; in the drawing and replaces it with the &amp;quot;replacetext&amp;quot; in this example.&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;If you want to replace the text &amp;quot;House&amp;quot; by the word &amp;quot;Shed&amp;quot;, you would call it like this:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;&lt;em&gt;vba run TxtRep_simple House | Shed&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style="margin-right:0px;" dir="ltr" align="left"&gt;Upper case and lower case of the search text must be exact so that it is found. In addition, this will only replace if the entire word is exactly the same. We are looking for the active model and the texts will be checked that if found, meaning that no text nodes or cells will be searched.&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr" align="center"&gt;&lt;a href="https://communities.bentley.com/products/microstation/w/microstation__wiki/22488.replacing-text-with-vba-part-2-complex-structures"&gt;&amp;gt;&amp;gt; CONTINUE TO PART 2 &amp;gt;&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;&amp;nbsp;&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 1: Introduction</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22463/replacing-text-with-vba-part-1-introduction/revision/2</link><pubDate>Thu, 09 Jul 2015 15:30:20 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:00eb74e4-d458-4aa0-862e-4735db1f5ebc</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22463/replacing-text-with-vba-part-1-introduction#comments</comments><description>Revision 2 posted to MicroStation Wiki by Tristan Anderson on 7/9/2015 3:30:20 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;&lt;strong&gt;&lt;span style="font-size:large;"&gt;Background Information&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The existing MicroStation functionality to search and replace features many options and variations. However, there are always cases in which a considerable effort has to be taken when larger inventories need to be changed, and at the same time a number of replacements have to be made. This short series of examples will address different problems that may arise in this matter. I will start with a simple example and add some more options later to cover many aspects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Simple Example for Substituting it by text in the current model&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following example searches the active model and searches for text that has been given as the first parameter when starting up the VBA routine. When this text is found, it is replaced by the text that was passed as the second parameter.I use the pipe character &amp;quot;|&amp;quot; as a delimiter when calling to separate the&amp;nbsp; parameters cleanly.&lt;/p&gt;
&lt;p&gt;Here is an example of how this can be done:&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;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
Sub TxtRep_simple()
Dim sToFind As String       &amp;#39; Find the text
Dim sToReplace As String    &amp;#39; Replace with this text
Dim CmdLine() As String
Dim Ee As ElementEnumerator
Dim Sc As New ElementScanCriteria
 
&amp;#39; As a separator between parameters, use &amp;quot;|&amp;quot;
CmdLine = Split(KeyinArguments, &amp;quot;|&amp;quot;)
&amp;#39; Cancel if incorrect parameters were given:
If UBound(CmdLine) &amp;lt;&amp;gt; 1 Then  &amp;#39; given the wrong parameter
    MessageCenter.AddMessage &amp;quot;Replace text: incorrect parameters were given, 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 - text to search
sToReplace = Trim(CmdLine(1))   &amp;#39;2.Parameter - new text
 
&amp;#39; Browse current model based on texts and examine
Sc.ExcludeAllTypes
Sc.IncludeType msdElementTypeText
Set Ee = ActiveModelReference.Scan(Sc)
Do While Ee.MoveNext
    With Ee.Current.AsTextElement
        If .Text = sToFind Then
            .Text = sToReplace
            .Rewrite
        End If
    End With
Loop
End Sub&lt;/pre&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When this routine is loaded, it can be started using the following syntax:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p&gt;&lt;em&gt;vba run TxtRep_simple findtext | replacetext&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;It searches for the &amp;quot;findtext&amp;quot; in the drawing and replaces it with the &amp;quot;replacetext&amp;quot; in this example.&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;If you want to replace the text &amp;quot;House&amp;quot; by the word &amp;quot;Shed&amp;quot;, you would call it like this:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;&lt;em&gt;vba run TxtRep_simple House | Shed&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style="margin-right:0px;" dir="ltr" align="left"&gt;Upper case and lower case of the search text must be exact so that it is found. In addition, this will only replace if the entire word is exactly the same. We are looking for the active model and the texts will be checked that if found, meaning that no text nodes or cells will be searched.&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr" align="center"&gt;&amp;gt;&amp;gt; Continue on to part 2 &amp;gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;&amp;nbsp;&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 1: Introduction</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/22463/replacing-text-with-vba-part-1-introduction/revision/1</link><pubDate>Thu, 09 Jul 2015 15:29:46 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:00eb74e4-d458-4aa0-862e-4735db1f5ebc</guid><dc:creator>Tristan Anderson</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/22463/replacing-text-with-vba-part-1-introduction#comments</comments><description>Revision 1 posted to MicroStation Wiki by Tristan Anderson on 7/9/2015 3:29:46 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;&lt;strong&gt;&lt;font size="4"&gt;Background Information&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The existing MicroStation functionality to search and replace features many options and variations. However, there are always cases in which a considerable effort has to be taken when larger inventories need to be changed, and at the same time a number of replacements have to be made. This short series of examples will address different problems that may arise in this matter. I will start with a simple example and add some more options later to cover many aspects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Simple Example for Substituting it by text in the current model&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following example searches the active model and searches for text that has been given as the first parameter when starting up the VBA routine. When this text is found, it is replaced by the text that was passed as the second parameter.I use the pipe character &amp;quot;|&amp;quot; as a delimiter when calling to separate the&amp;nbsp; parameters cleanly.&lt;/p&gt;
&lt;p&gt;Here is an example of how this can be done:&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;
&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 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_simple()&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;&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;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 the text&lt;/code&gt;&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 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;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 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 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 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 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 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 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;&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 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;&amp;nbsp;&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 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, use &amp;quot;|&amp;quot;&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 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 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 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 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 were given:&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;&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;&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;&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;&amp;nbsp;given the wrong parameter&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;&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;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: incorrect parameters were given, see details&amp;quot; , &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 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 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 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 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 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;&amp;nbsp;&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 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 -&amp;nbsp;text to search&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 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 - new text&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;&amp;nbsp;&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 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; Browse current model based on texts and examine&lt;/code&gt;&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 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 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 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 number23 index22 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;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 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 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 number25 index24 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;With&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.Current.AsTextElement&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;&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;.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 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;&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;.Text = sToReplace&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;&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;.Rewrite&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;&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 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 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;With&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 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 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 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 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 keyword" 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;&amp;nbsp;&lt;/div&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;When this routine is loaded, it can be started using the following syntax:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p&gt;&lt;em&gt;vba run TxtRep_simple findtext | replacetext&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;It searches for the &amp;quot;findtext&amp;quot; in the drawing and replaces it with the &amp;quot;replacetext&amp;quot; in this example.&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;If you want to replace the text &amp;quot;House&amp;quot; by the word &amp;quot;Shed&amp;quot;, you would call it like this:&lt;/p&gt;
&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;&lt;em&gt;vba run TxtRep_simple House | Shed&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p style="margin-right:0px;" dir="ltr" align="left"&gt;Upper case and lower case of the search text must be exact so that it is found. In addition, this will only replace if the entire word is exactly the same. We are looking for the active model and the texts will be checked that if found, meaning that no text nodes or cells will be searched.&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr" align="center"&gt;&amp;gt;&amp;gt; Continue on to part 2 &amp;gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin-right:0px;" dir="ltr"&gt;&amp;nbsp;&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>