You must Sign In to post a response.
  • Category: .NET

    Check Microsoft office is install in PC or not

    i am doing a window application in VB.net.
    In this project i am printing data in excel, means i have made a function that will exports my data from datagridview to excel.

    So as per Validation i wanna check that Microsoft office is install in the machine or not, if not it will a message box.

    Help...
  • #586170
    try this code



    using (RegistryKey regWord = Registry.ClassesRoot.OpenSubKey("Word.Application"))
    {
    if (regWord == null)
    {
    lblmsg.Text = "Microsoft Word is not installed";
    }
    else
    {
    lblmsg.Text = "Microsoft Word is installed";
    }
    }



    hope this will help you

  • #586174
    Thanks for ur posting, but its not working
    do i have call any namespace.
    Registry comes in which namesspace ?

  • #586191
    Using Microsoft.Win32;


    public bool CheckOffice()
    {
    using (RegistryKey regWord = Registry.ClassesRoot.OpenSubKey("Word.Application"))
    {
    if (regWord == null)
    {
    return true;
    }
    else
    {
    return false;
    }
    }

    All is well.
    Thanks,
    Dharma
    Editor,Mentor,MVM
    Try and fail but don't fail and try


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.