0

I have wrote a program which is able to strip out the comments from a word document and create another word document to keep a nice clean audit log. The app works fine however now I want to make it easier for the user by adding an option to the context menu when you right click on a .docx file (and only a docx file).

When you do this it will then kick off the app with additional command line parameters which include the path to the file.

By the research that I have done I realise I am going to have to write something to the registry, but I can't seem to find out where I need to write it too. Also I don't really know how to get the path to the file from the registry key. Am I correct in thinking you just need to put "%1" as a command line argument?

FYI I am distributing my app to people by using a .vdproj if that is any help to anyone.

I am just looking to be pointed in the right direction really, maybe open a dialogue with someone who is more knowledgeable on this area.

Keithin8a
  • 961
  • 7
  • 32
  • @SteveDanner I have been trying to search for that for ages! This explains exactly how to do it so thank you. I however am struggling to find the options for the .docx format. when I find it in the locations it suggests. The registry keys say that it opens up with wordpad not word. And it has keys for context items which do not exist such as "printto" which when you right click the docx file it does not show. What am I missing? – Keithin8a Oct 15 '15 at 13:42
  • Did you restart your machine (or at least sign out and back in) after making the changes? The shell has to be rebooted before changes like that take effect. – Steve Danner Oct 15 '15 at 13:48
  • @SteveDanner Yeah. I also found another class called ms-word which seemed to actually open ms word unlike the docxfile class which suggested it opened wordpad. I have added the command to both now and it won't appear on the context menu. – Keithin8a Oct 15 '15 at 14:26
  • 1
    @SteveDanner I used an external tool which does exactly what I need and it turns out that to get it on the right extension you need to Add the command to Word.Document.12. Thanks for your help – Keithin8a Oct 15 '15 at 14:56
  • No problem, glad you found it! – Steve Danner Oct 15 '15 at 14:57

0 Answers0