05-27-2015
07:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-27-2015
07:21 AM
I mixed your code with mine:
Public Sub addMyTitleBlock()
Dim oDrawDoc As DrawingDocument
'Ensure the active document is a drawing
If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Set oDrawDoc = ThisApplication.ActiveDocument
' get the Title blocks (definitions)
Dim oTitleBlks As TitleBlockDefinitions
Set oTitleBlks = oDrawDoc.TitleBlockDefinitions
' add a new title block definition
Dim oTitleBlk As TitleBlockDefinition
Set oTitleBlk = oTitleBlks.Add("myxTitleBlock")
Dim osheet As Sheet
Set osheet = oDrawDoc.ActiveSheet
Dim otitleblock As titleblock
Set oNewTitleBlockDef = oDrawDoc.TitleBlockDefinitions.Item("myxTitleBlock")
Set otitleblock = osheet.AddTitleBlock(oNewTitleBlockDef)
End If
End Sub
And your myxtitleblock has been added to my Sheet.
Now I see that I have problems with prompts probably. I was sure if I leave it empty then is OK.
I will try to fix it and let you know.