language and 'format'

C

Chris

Hi

included in a vba-module I need to find out when a certain file is modified.
I use the code:

date1 = Format("file.doc".datelastmodified, "mmmm yyyy")

the variable is now giving the date 'Maj 2005' in danish as my Windows is in
Danish.

I need to translate this date into different languages: English 'January
2005', Swedish 'Januari 2005' etc. How can I do this in vba?
 
J

Jezebel

Dim pDate as date
Dim pMonth as long

pDate = Doc.DateLastModified
pMonth = Month(pDate)

English = Choose(pMonth, "January", "February", ...) & " " & Year(pDate)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top