Hier mal ein kleines "sehr" einfaches Makro. Es erstellt in der unteren linken Ecke eine Textbox mit der aktuellen Zeit. Automatisch läuft da aber noch nichts ab.
Code:
Public Sub SketchTextAdd()
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
' Create a new sketch on the active sheet.
Dim oSketch As DrawingSketch
Set oSketch = oDrawDoc.ActiveSheet.Sketches.Add
' Open the sketch for edit so the text boxes can be created.
' This is only required for drawing sketches, not part.
oSketch.Edit
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry
' Create text with simple string as input. Since this doesn't use
' any text overrides, it will default to the active text style.
Dim sText As String
sText = VBA.Date$ & "-" & VBA.Time$
Dim oTextBox As TextBox
Set oTextBox = oSketch.TextBoxes.AddFitted(oTG.CreatePoint2d(1.01, 1.5), sText)
' Exit the sketch from the edit environment.
oSketch.ExitEdit
End Sub