![]() |
|
#1
|
|||
|
|||
![]()
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 ![]() |
![]() |
Tags |
current date, macro, vba |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Fesazu | Word | 3 | 02-08-2018 12:15 AM |
Spell check macro within macro button field doesn't work in one document | samuelle | Word VBA | 0 | 07-20-2016 02:27 AM |
![]() |
ptmuldoon | Word | 2 | 05-12-2015 12:19 PM |
Save As Macro using first line of document as document name | redzan | Word VBA | 1 | 01-31-2015 09:24 PM |
![]() |
arkay | Mail Merge | 1 | 03-20-2012 11:50 PM |