Using national language support in Office with VBA

Localization demo application screenshot

If you need to handle multiple languages, get some specific regional settings, or do things like implement dynamic runtime language switching in your Microsoft Office solutions, you can leverage some additional help using the national language support Win32 API in VBA. Do you know why you have to use the US English date format when… Continue reading Using national language support in Office with VBA

How do I compute the length of the longest text for a date in Word ?

A Word document to compute the length of the longest text for a date in Word. Working on the layout of a Microsoft Word French and English versions of a document template with a customer, we were trying to determine where to position a tab, so that we had the document date appear on the… Continue reading How do I compute the length of the longest text for a date in Word ?

Comment connaître la longueur du plus long texte de la date du jour de l’année avec Word ?

Je travaillais hier matin avec un client sur son modèle de lettre Word. Sur ce modèle de lettre que l’on veut décliner en français et en anglais, la date est positionnée grâce à un tabulateur, vers le bord droit de la page. On a naturellement écrit la date du jour, lundi 18 janvier 2016, pour… Continue reading Comment connaître la longueur du plus long texte de la date du jour de l’année avec Word ?

Share the Clipboard with VBA and the Windows API

Accessing the clipboard in Windows becomes quite tricky in VBA, particularly if you have to stay 32 and 64 bits compatible. Here’s my compilation of portable routines, inspired by MSDN, Internet scraping and good sense. First the Declares section (I know, it pours out of the frame on the right, just select and copy the… Continue reading Share the Clipboard with VBA and the Windows API

Microsoft Access Databases ADO connection strings for 32/64 bits

If you try to open a connection to an Access database via ADO, you’ll have to use a different provider, whether you’re coding for 32 or 64 bits environments. Here’s a utility function I use for that (updated 25.02.2014):

Of course you have to have the correct jet engine files installed on the target… Continue reading Microsoft Access Databases ADO connection strings for 32/64 bits