Detect Version of Office within Access 2007 code

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?
terpsichoreAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
try
application.version
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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
 
Nick67Commented:
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
terpsichoreAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:

 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
 
Rey Obrero (Capricorn1)Commented:
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
 
Nick67Commented:
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
 
terpsichoreAuthor Commented:
excellent dialog with the group, very insightful and quick.
0
 
Rey Obrero (Capricorn1)Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.