none
How to access the "New" context menu on files but programatically? RRS feed

  • Question

  • Hi,

    I have been searching but couldn't find anything about how to programatically trigger the New command (such as with existing Word files you can right-click then click New and it will make a new document based on the one selected).

    Does anyone know what this is called or if it's possible to trigger with some shell execute code perhaps?

    Thanks in advance

    Thursday, September 5, 2019 10:40 AM

Answers

  • For example =>

    ProcessStartInfo psi = new ProcessStartInfo();
    psi.FileName = "E:\\test.doc";
    psi.Verb = "new";
    Process.Start(psi);

    • Marked as answer by Danzence Wednesday, September 11, 2019 1:25 PM
    Thursday, September 5, 2019 11:43 AM

All replies

  • Hello,

    See the following GitHub repository. The following Code Project article explains how to do the context menus.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, September 5, 2019 11:42 AM
    Moderator
  • For example =>

    ProcessStartInfo psi = new ProcessStartInfo();
    psi.FileName = "E:\\test.doc";
    psi.Verb = "new";
    Process.Start(psi);

    • Marked as answer by Danzence Wednesday, September 11, 2019 1:25 PM
    Thursday, September 5, 2019 11:43 AM
  • There really is nothing available since the procedure to create a new document depends on the application.


    Sam Hobbs
    SimpleSamples.Info

    Friday, September 6, 2019 6:15 PM