Inserting snippets from macros

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-04-19T12:48:27Z Indexed on 2010/04/19 12:53 UTC
Read the original article Hit count: 457

Filed under:
|
|

In Visual Studio 2008 I had a macro which would insert a snippet and input today's date in one of the replacements. When I try to run this macro in VS 2010 it doesn't work. No matter how I try it will not insert a snippet. When I try the following command:

DTE.ExecuteCommand("Edit.InvokeSnippetFromShortcut", "snippetName")

This fails with error "Error HRESULT E_FAIL has been returned from a call to a COM component.

I tried recording a new macro and when I pressed the keyboard shortcut for inserting a snippet (Ctrl+K, Ctrl+X) VS gave the error "The command Insert Snippet is not currently available."

Did MS remove the ability to insert snippets from macros? If so this really is a shame because macros have functionality not found in snippets and vice versa.

© Stack Overflow or respective owner

Related posts about VS2010

Related posts about macros