Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: GeorgK

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.