View Single Post
 
Old 09-22-2019, 09:45 PM
bluefate25 bluefate25 is offline Windows 10 Office 2010
Novice
 
Join Date: Sep 2019
Posts: 2
bluefate25 is on a distinguished road
Default

Thank you both for your responses! I have been very frustrated with getting this to work (having no experience with macros) so this has been truly helpful!


What I ended up writing to get this to work was the following:


Sub AutoOpen()

If MsgBox("Run Macro?", vbYesNo, "Message") = vbYes Then Call DATEPLUS7
End Sub


Sub DATEPLUS7()
Application.ScreenUpdating = False
Dim BmkRng As Range: Const BmkNm As String = "MyDate"
With ActiveDocument
If .Bookmarks.Exists(BmkNm) Then
Set BmkRng = .Bookmarks(BmkNm).Range
BmkRng.Text = Format(Date + 7, "mmmm d, yyyy")
.Bookmarks.Add BmkNm, BmkRng
End If
.Fields.Update
End With
Application.ScreenUpdating = True


End Sub


I'm sure I'll have more questions in the future
Reply With Quote