Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 11-18-2019, 12:25 AM
ArviLaanemets ArviLaanemets is offline Calculate week in Word document based on date entered into same document Windows 8 Calculate week in Word document based on date entered into same document Office 2016
Expert
Calculate week in Word document based on date entered into same document
 
Join Date: May 2017
Posts: 949
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Quote:
Originally Posted by Guessed View Post
In your Word document ...

Hi


It worked, but I didn't get full information last week, so I had to modify a bit


The document is printed out when a delivery is sent. The date is inserted automatically whenever the document is opened (the field is created using Insert > Date and Time). So instead of Document_ContentControlOnExit() I had to use
Code:
Private Sub Document_Open()
  
    ActiveDocument.SelectContentControlsByTitle("TheWeek")(1).Range.Text = DatePart("ww", Date, 2, 2)

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate week in Word document based on date entered into same document 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
Calculate week in Word document based on date entered into same document Formula to auto calculate Day of the week based on Date prasad@dmci.ca Excel 1 11-29-2011 01:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft