> When i manual want to do it, (insert -> date/time) i can choose a
> language.
>
> Is something possible with a macro?
Yes.
Below VBA statement is the result of a recorded macro doing exactly what you
asked ...
Selection.InsertDateTime DateTimeFormat:="dddd d MMMM yyyy",
InsertAsField _
:=False, DateLanguage:=wdDutch, CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
Krgrds,
Perry
> Format(Date, "d mmmm yyyy")
>
[quoted text clipped - 10 lines]
>
> Is something possible with a macro?
mapsit - 05 Jan 2006 08:33 GMT
What's live easy....
Ok, but thats half wat i want. I don't want that date into my document,
but i want the date into a variable for example MyDate = ......
With a if then statement i want to define different values (and
different datelangauges) to MyDate.
Is this possible??
> Below VBA statement is the result of a recorded macro doing exactly what you
> asked ...
[quoted text clipped - 3 lines]
> :=False, DateLanguage:=wdDutch, CalendarType:=wdCalendarWestern, _
> InsertAsFullWidth:=False
Helmut Weber - 06 Jan 2006 03:12 GMT
Hi,
I guess you have to insert the language specific date
somewhere in your doc or in other one, if you like,
and read what was inserted into a variable.
Like:
Sub test09987()
Dim sDat As String
Dim rTmp As Range
Set rTmp = ActiveDocument.Range
rTmp.InsertAfter vbCrLf
' create a new paragraph at the end of the doc
Set rTmp = rTmp.Paragraphs.Last.Range
' set rTmp to be this paragraph's range
rTmp.InsertDateTime DateTimeFormat:="dddd d MMMM yyyy", _
InsertAsField:=False, DateLanguage:=wdDutch, _
CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
sDat = rTmp.Text
' assign the text of that range to a variable
sDat = Left(sDat, Len(sDat) - 1)
' cut off the paragraph mark
MsgBox "[" & sDat & "]" ' for testing
rTmp.Delete
' delete the created paragraph
End Sub
If that's alright and you need a little help
on creating a dialog or so for choosing a language,
let us know.

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"