![]() |
|
#3
|
||||
|
||||
|
In your Word document, put two content controls
Date Picker Content Control: give it a title of "TheDate" Plain text Content Control: give it a title of "TheWeek" Then in your ThisDocument module, add this code Code:
Private Sub Document_ContentControlOnExit(ByVal aCC As ContentControl, Cancel As Boolean)
Dim aDate As Date
If aCC.Title = "TheDate" Then
aDate = CDate(aCC.Range.Text)
ActiveDocument.SelectContentControlsByTitle("TheWeek")(1).Range.Text = DatePart("ww", aDate, 2, 2)
End If
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
split word document based on bookmarks with each new document title of the bookmark
|
megatronixs | Word VBA | 9 | 09-05-2020 02:29 PM |
| data entered in one workbook should be updated in other relevant workbook based on the date | vedha | Excel | 0 | 04-24-2015 08:45 PM |
| calculate date if date entered in cell, do nothing if blank | ConfuddledOne | Excel | 3 | 11-07-2014 09:37 AM |
Formula to auto calculate Day of the week based on Date
|
prasad@dmci.ca | Excel | 1 | 11-29-2011 01:05 PM |