Insert a snippet from a Visual Studio macro

Posted by Kyralessa on Stack Overflow See other posts from Stack Overflow or by Kyralessa
Published on 2009-09-04T21:51:17Z Indexed on 2010/05/01 10:07 UTC
Read the original article Hit count: 485

I have a situation where I want to run a Visual Studio macro that has the user type something in an InputBox, then inserts a snippet and includes that text somewhere in it. Unfortunately, I can't figure out how to insert the snippet from macro code. It seems like it'd be something like

DTE.ExecuteCommand("Edit.InvokeSnippetFromShortcut")

or

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

but those don't work. Any ideas?

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about macros