| Change Text in a Block |
|
|
|
| Tutorials | |||
|
Function to replace a text in a Block Code: [code] Public Function ChangeTextinBlock(ByVal OldText As String, ByVal NewText As String) '***************************************************
'******* Code from VisibleVisual.com ***************
'******* Searches text in Block and changes it *****
'***************************************************
Dim i As Integer
Dim z As Integer
Dim BlkText As String
For i = 0 To ThisDrawing.Blocks.Count - 1
For z = 0 To ThisDrawing.Blocks.Item(i).Count - 1
BlkText = ""
On Error Resume Next
BlkText = ThisDrawing.Blocks.Item(i).Item(z).TextString
If BlkText Like OldText Then
ThisDrawing.Blocks.Item(i).Item(z).TextString = NewText
End If
Next z
Next i
ThisDrawing.Regen acAllViewports
End Function
[/code]
|


