- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning all! I have been writing a few programs to help me speed up some of the nittygritty work that we all have to do from time to time. Currently there is a need to go through a very large quantity of drawings that have revision blocks and revision tags in them. For ease, they are just blocks that are inserted as Sketched Symbols. These symbols are built into our standard template file, so they will always be available for use, but I want to purge them off of the actual document so they aren't used anywhere. Currently I have the following code but I get a "Method 'Delete' of object 'SketchedSymbolDefinition' failed"
I've bounced around the code quite a bit, and I don't know the solution.
Thanks for all the help!
----------------------------------------------------------------------
Public Revision As Integer
Private Sub Validateform3()
If Revision_Check = 0 Then
Revision = 0
Else
Revision = 1
End If
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub Revision_Check_Click()
Call Validateform3
End Sub
Private Sub Run_Cleanup_Click()
Call Validateform3
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oSketchedSymbolDef As SketchedSymbolDefinition
If Revision = 1 Then
For Each oSketchedSymbolDef In oDoc.SketchedSymbolDefinitions
If oSketchedSymbolDef.Name = "REVISION BLOCK" Then
oSketchedSymbolDef.Delete
Else
End If
Next
End If
End Sub
Solved! Go to Solution.