VBA : Date Picker With Long Date Format in Ms Word

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

VBA : Date Picker With Long Date Format in Ms Word

Post by Susanto3311 »

hi all

i'm looking for date picker using with long date format (dd-mmmm-yyyy)
i want date picker can save as Ms Word Add-ins (permanent into ms word)
i hope someone give me a solution.
note:
date picker is easy to use & simple.

susanto

User avatar
SpeakEasy
4StarLounger
Posts: 544
Joined: 27 Jun 2021, 10:46

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by SpeakEasy »

D0oesn't the Date Picker Content Control already provide exactly this functionality?

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by Susanto3311 »

hi.. I have trying Date Picker Content Control, but I can,t see for long date format where is it.
Whatever, if possible date Picker can use/show Long Date Format.

User avatar
Jay Freedman
Microsoft MVP
Posts: 1316
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by Jay Freedman »

In the Properties dialog, enter the format you want in the "Display the date like this" box. You don't have to pick any of the suggestions in the list below it. You can enter your long date format as dd-MMMM-yyyy (note that you need to use MMMM and not mmmm).
1.png
In VBA, you can do it this way:

Code: Select all

    Dim cc As ContentControl
    Set cc = ActiveDocument.ContentControls.Add(Type:=wdContentControlDate, Range:=Selection.Range)
    cc.DateDisplayFormat = "dd-MMMM-yyyy"
You do not have the required permissions to view the files attached to this post.

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by Susanto3311 »

hi Jay Freedman..
working well!!! thank you so much.

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by macropod »

And, for something more elaborate (i.e. using Ordinal dates), see: https://www.msofficeforums.com/20611-post2.html
Paul Edstein
[Fmr MS MVP - Word]

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by Susanto3311 »

macropod wrote:
09 Mar 2022, 04:00
And, for something more elaborate (i.e. using Ordinal dates), see: https://www.msofficeforums.com/20611-post2.html
hi..i have tested that macro, but i don't see anything..
how to use/make add-ins that macro?

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by macropod »

Did you name the add the macro to the document's 'This Document' code module, as indicated in the post?
Did you name the Content Control 'Mydate', as indicated in the post?
Did you exit the Content Control after selecting the date?
Paul Edstein
[Fmr MS MVP - Word]

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by Susanto3311 »

hi macropod...
i have do what you suggestion..but
still i don't see anything change
plese, give me more easy steps..

User avatar
Charles Kenyon
5StarLounger
Posts: 609
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by Charles Kenyon »


User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: VBA : Date Picker With Long Date Format in Ms Word

Post by macropod »

Susanto3311 wrote:
09 Mar 2022, 17:25
hi macropod...
i have do what you suggestion..but
still i don't see anything change
plese, give me more easy steps..
There are no more steps.
Paul Edstein
[Fmr MS MVP - Word]