MS Word 2010 - Filename to include Datepicker Value
I have composed a Template/Form in Word 2010 for Team Meeting Minutes. The date of the meeting is selected from a Date Picker Content Control. I have inserted a [Save] button with the purpose of naming the file consistantly, using the value of the Date Picker.
Here is the code:
Private Sub CommandButton50_Click() ActiveDocument.SaveAs FileName:="C:\Users\Richard\Documents\Meeting Minutes\2013\September\Team Meeting Minutes" & ActiveDocument.Bookmarks("Date").Range.Text & ".doc" End Sub
What I would like to do, is break the date down into Month and Year components so that the file can be saved in the correct folder sorted by Year and Month.
I've searched everywhere on the internet for weeks and am still stumped. I have had limited success with Format(Value, "yyyy") using msgbox to confirm the values I'm getting but run into all sorts value mismatch problems.
I am supposing my problem is primarily the way I'm calling for the Date Picker value, at this time you'll note I'm using Bookmarks of Date Picker Tag named "Date" (yes I know the name is dangerous and probably should be called "MeetingDay" or similar)
Any suggestions, help appreciated. The full working code would be handy rather than just a part explanation, I'm still very much a Beginner level ability.
Cheers, Rick
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Microsoft Word Forum.