1

I want to add a field via macro to my presentation/slide that automatically shows the current date.

 Shape shape = [Find a text shape to edit]
 shape.TextFrame.TextRange.Text = "Some Text  | " + [Field showing Current date]

I don't want to insert a text that contains the current date:

 Shape shape = [Find a text shape to edit]
 shape.TextFrame.TextRange.Text = "Some Text  | " + DateTime.Now

As I descriped the resulting textshape should contain some constant text + a field showing the current date.

1 Answer 1

4

This will insert a time/date field into your text box:

Dim oSh As Shape
Set oSh = ActiveWindow.Selection.ShapeRange(1)

With oSh.TextFrame.TextRange
    .Text = "Some text | "
    .InsertDateTime ppDateTimeHmm, True
End With
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.