none
Parsing Outlook Version RRS feed

  • Question

  • Hi All, 

    My second day of VBS and I need your help. I researched this but not well versed to understand. 

    I want to parse the Outlook version from 16.0.0.9029 to just 16, tried different built-in functions but not getting the desired results. Your help is much appreciated. 

    Dim App
    Dim test 

    Set App = CreateObject("Outlook.Application")
    Set test = (Round(app.VERSION))
    Wscript.echo test
    Wscript.Quit

    Output:

    outlookversion.vbs(5, 1) Microsoft VBScript runtime error: Type mismatch: '[string: "16.0.0.9029"]'

    Friday, March 30, 2018 2:39 PM

Answers

  • Forget about VBS as it is obsolete. Use PowerShell.

    $ol = New-Object -ComObject Outlook.Application
    ([version]$ol.Version).Major

    VBScript:

    ver = Split(app.Version,".")(0)


    \_(ツ)_/

    • Marked as answer by rvrmak Saturday, March 31, 2018 6:03 AM
    Friday, March 30, 2018 2:48 PM

All replies

  • Don't use VBS; use PowerShell.


    PS C:\> ([Version] (New-Object -ComObject "Outlook.Application").Version).Major
    16
    


    -- Bill Stewart [Bill_Stewart]

    Friday, March 30, 2018 2:44 PM
    Moderator
  • Forget about VBS as it is obsolete. Use PowerShell.

    $ol = New-Object -ComObject Outlook.Application
    ([version]$ol.Version).Major

    VBScript:

    ver = Split(app.Version,".")(0)


    \_(ツ)_/

    • Marked as answer by rvrmak Saturday, March 31, 2018 6:03 AM
    Friday, March 30, 2018 2:48 PM
  • All versions of Windows have PowerShell installed except Vista.

    All major settings for Outlook can be managed by GP.

    I gave you the VBScript answer in my post.

    To learn how to cor4rectly manage Outlook post in the Outlook forum.


    \_(ツ)_/


    • Edited by jrv Saturday, March 31, 2018 6:05 AM
    Saturday, March 31, 2018 6:05 AM
  • There is no need for scripting to do this. Create registry keys and values in Group Policy Preferences and use File Match with Match file version as Match type in Item-Level Targeting.

    Edit:
    If you have a mix of 32-bit and 64-bit Office versions, or you have been inconsistent when choosing installation path, it would be easier to use Registry Match as demonstrated in this screenshot:

    https://imgur.com/a/6Lxzv

    Saturday, March 31, 2018 6:50 AM
  • Thank you, Leif-Arne. I am not a admin but tested your suggestion in my test environment and it works great.

    ~rvrmak

     
    Sunday, April 1, 2018 5:57 AM