Detect Version of Office within Access 2007 code

Posted on 2011-09-26
Last Modified: 2012-06-21
Based on which version of Office (2007 or 2010) that a user has installed on the local machine, I need to take certain action. Is there any easy way to detect this?
Question by:terpsichore
  • 3
  • 2
  • 2
  • +1
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 500 total points
ID: 36599834
LVL 57
ID: 36599922
There's also the SYSCMD call:

Function GetVersion() As String
' Determine the version of Microsoft Access
' used to create this application.

      GetVersion = SysCmd(acSysCmdAccessVer)

End Function

LVL 26

Expert Comment

ID: 36599929
Ditto to @capricorn1

If Application.Version > 11 Then
    'because this is the use I have for knowing if things are A2007+
    'sub in what you need
    Call SaveAsOfficePDF(stDocName)
    Exit Sub
End If

Private Sub SaveAsOfficePDF(stDocName As String)
Dim FormatValue As String
If Application.Version > 11 Then
    FormatValue = "PDF Format (*.pdf)"
    FormatValue = acFormatRTF
End If
'yes if it's RTF the file ending will be screwy--but it should never get that far anyway
DoCmd.OpenReport stDocName, acPreview
DoCmd.OutputTo acOutputReport, stDocName, FormatValue, "c:\tempPdf\" & Reports(stDocName).Caption & ".pdf"
DoCmd.Close acReport, stDocName, acSaveYes
End Sub
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 36599947
just to be clear - I need the application installed on the machine, NOT the version of the application that created this Access app... please confirm solution if you would. Thanks.
LVL 57
ID: 36599956

 BTW, if you need the build number (which includes service packs and hotfixes), see the procedure here:

LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36599962
just to be clear,
what is your intention after you found the version installed on the machine?

you need to run a .bat file ?
LVL 26

Expert Comment

ID: 36599986
Application.Version detects the running version of MS Access.
It is not concerned with the mdb or Accdb file type, but rather the version of the executable.

Author Closing Comment

ID: 36600015
excellent dialog with the group, very insightful and quick.
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36600047

you could have split the points for the comments that have given you more info..

click on Request Attention and ask that the thread be reopen to allocate points properly..

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access Application Initial Installation 10 49
Access syntax 1 32
Fast way to syncronize two MS Access tables and audit changes 4 35
How do a DCount on a report 1 12
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question