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: MechMachineMan

For all asking in the future:

Public Sub addMyTitleBlock()
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
' get the Title blocks (definitions)
Dim oTitleBlks As TitleBlockDefinitions
Set oTitleBlks = oDrawDoc.TitleBlockDefinitions

Dim osheet As Sheet
Set osheet = oDrawDoc.ActiveSheet


Dim sPromptStrings(1 To 17) As String
sPromptStrings(1) = ""
sPromptStrings(2) = ""
sPromptStrings(3) = ""
sPromptStrings(4) = ""
sPromptStrings(5) = ""
sPromptStrings(6) = ""
sPromptStrings(7) = ""
sPromptStrings(8) = ""
sPromptStrings(9) = ""
sPromptStrings(10) = ""
sPromptStrings(11) = ""
sPromptStrings(12) = ""
sPromptStrings(13) = ""
sPromptStrings(14) = ""
sPromptStrings(15) = ""
sPromptStrings(16) = ""
sPromptStrings(17) = ""


Dim otitleblock As titleblock
'Set oNewTitleBlockDef = oDrawDoc.TitleBlockDefinitions.Item("myxTitleBlock")
'Set otitleblock = osheet.AddTitleBlock(oNewTitleBlockDef)
Set oNewTitleBlockDef = oDrawDoc.TitleBlockDefinitions.Item(1) 'here you may put your titleblock name in ("my titleblock name")
Set otitleblock = osheet.AddTitleBlock(oNewTitleBlockDef, , sPromptStrings)

End Sub

What is important for me :  I had to write lines like 

sPromptStrings(17) = ""

without them it is not working.

In my example I have 17 text prompts.

 

Thanks for directing me ... :slightly_smiling_face: