Solved

Detect Version of Office within Access 2007 code

Posted on 2011-09-26
9
215 Views
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?
0
Comment
Question by:terpsichore
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 36599834
try
application.version
0
 
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


Jim.
0
 
LVL 26

Expert Comment

by:Nick67
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)"
Else
    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
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:terpsichore
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.
0
 
LVL 57
ID: 36599956

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

http://allenbrowne.com/ser-53code.html

Jim.
0
 
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 ?
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36599986
Confirmed
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.
0
 

Author Closing Comment

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

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36600047
terpsichore,

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..
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

777 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