I'm making one of my first Macros and I found the script that I needed. I just can't get it to run when I open the template. It works when I go to the Macros and click on run, but not when I open the file.
Thanks
Sub SetSummaryInfo()
Dim dp As Object
If Documents.Count > 0 Then
Set dp = Dialogs(wdDialogFileSummaryInfo)
' Set "Title" to a new value.
dp.Title = "My Title"
' Set the value.
dp.Execute
' Save the changes.
ActiveDocument.Save
' Display the dialog.
' Note: Using the Display method will not keep changes
' manually entered into the dialog box. To keep changes
' manually entered in the dialog box, use the Show method.
dp.Display
End If
End Sub
Thanks
Sub SetSummaryInfo()
Dim dp As Object
If Documents.Count > 0 Then
Set dp = Dialogs(wdDialogFileSummaryInfo)
' Set "Title" to a new value.
dp.Title = "My Title"
' Set the value.
dp.Execute
' Save the changes.
ActiveDocument.Save
' Display the dialog.
' Note: Using the Display method will not keep changes
' manually entered into the dialog box. To keep changes
' manually entered in the dialog box, use the Show method.
dp.Display
End If
End Sub