How to block right click menu (Context Menu) on MS-Office documents with VC++.

Posted on 2008-11-03
Last Modified: 2013-11-20
I have a application which opens MS-Office documents (Word,Excel,PPT). While opening Word file OLE creates ~WRO0001.doc" file. When user right click on this file, it opens this file in WinWord with options available (e.g. New,Open,Edit).
I want to disable this right click menu (Context menu). Please let me know is there any way to block this context menu for Office applications (e.g. .doc files) i.e I dont want this file to open outside of my application.
Question by:ILGDRM
    LVL 49

    Expert Comment

    I cannot recommend it.
    You are talking about changing the file association for such common files as MS Word documents and Excel spreadsheets as used in Windows Explorer.  Making such a change to a user's system would be unacceptable to most users (certainly to anybody I've ever met).

    Author Comment

    This is fine but what we want is to restrict specific menu item in popup menu. Is there any way of doing this.
    LVL 49

    Accepted Solution

    Would blocking the context menu really even solve your problem?

    For instance, couldn't a person copy that file, give it a different name, and then open it using some other tool that understands the file layout?
    Or he could even manually use the Ms Word command line:
         C:\Program Files\Microsoft Office\Office\winword c:\temp\~WRO0001.doc
    ... regardless of how you trapped or misdirected context-menu commands,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Suggested Solutions

    Title # Comments Views Activity
    Specific format 21 105
    strCopies  challenge 17 60
    White board coding practice 3 27
    Microsoft Word Macros and VBA Scripts 3 12
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
    The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now