Q: Briant Manix writes: "Do you know how to get basic system specification info from the PC? I would imagine that the function would either use a Windows API or e look up in the Registry. I want to get an Access app to use VBA to interrogate the PC to determine if it meets the pre- install requirements."
A: Years ago (maybe in Access 2 or 95) I dimly remember doing something (probably with API calls) to put some system information on an Access form, but I can't find this information currently (and if I could, it might not work with Access 2003 or 2007).
You can get a fair amount of system information through the Word System object without API calls (set a reference to Word in your Access code so you can use named constants for the property arguments). However, it is not too accurate at present; apparently it has not been updated for many years. I got "Windows NT" for the OS (on a computer running Win XP SP 2) and "Pentium" for the processor (it is actually a dual-core Intel chip). There are no arguments for memory or available drives. Figure C shows the attributes of the System object in the Object Browser:
Figure C. The Word System object in the Object Browser
There is a list of API calls on the Microsoft Web site. However, there is no explanation of the calls, and no examples of usage.
Another possibility is to use the PrivateProfileString property of the Word System object (this is a hidden property, so you won't see it in the Object Browser unless you turn on hidden members display). The problem with this method is that the Registry is different on different computers, depending on their OS, so you can't depend on getting reliable information from the same Registry key on all computers. The lines below print the Documents path to the Immediate window:
Set appWord = GetObject(, "Word.Application")
strDocsPath = appWord.System.PrivateProfileString("", _
Folders", "Personal") & "\"
Debug.Print "Docs path: " & strDocsPath
Article posted: Monday, 05 May 2008
there's more ...
If you liked this article you'll LOVE our new ebooks.
Windows 8 for Microsoft Office users A practical guide the new, changed and unfamiliar in Windows 8
A focused and unvarnished look at Windows 8, especially written for
the many people who use Microsoft Office Get it today
- click here.
ORGANIZING OUTLOOK EMAIL - tame your Outlook 2010 Inbox
100+ pages of practical tips and help to streamline,
automate and search your Inbox. Get more
than you ever thought possible from Outlook. Read it today
- click here.