Archive for the ‘VBA’ Category


If you need to insert a date for a specific locale in MS Word, try the following subroutine:

Sub InsertLocalizedDate()
' To insert a date using a particular locale.
Selection.InsertDateTime DateTimeFormat:="dd MMMM yyyy", InsertAsField:= False, DateLanguage:=wdEnglishUK, CalendarType:=wdCalendarWestern, InsertAsFullWidth:=False
End Sub


If you are stuck…

posted by Knut Torgersen
Apr 18

If you try accomplishing something “simple” that you need for instance MS Word to perform, record a test macro and inspect the resulting macro. There will be a lot of overhead, so remove and trim down as needed and you get yourself the code lines you need for your project to work.