Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
498 Views, 6 Replies

addtitleblock --simplest test

I tried to add title block in many ways (using macro) but without success.

Here is a code:

 

Sub test()
    Dim odrawdoc As DrawingDocument
    Set odrawdoc = ThisApplication.ActiveDocument
    Dim oNewTitleBlockDef As TitleBlockDefinition
    Dim oSheet As Sheet
    Dim titleblock As titleblock
    Set oSheet = odrawdoc.ActiveSheet
    Set oNewTitleBlockDef = odrawdoc.TitleBlockDefinitions.Item(1)
    Set titleblock = oSheet.addTitleBlock(oNewTitleBlockDef)
'    Call oSheet.addTitleBlock(oNewTitleBlockDef)
    
    
End Sub

I got run time error 5 on line :

Set titleblock = oSheet.addTitleBlock(oNewTitleBlockDef)

 what is wrong?

 

Michal