gpt4 book ai didi

visual-studio - 很棒的 Visual Studio 宏

转载 作者:行者123 更新时间:2023-12-03 05:30:38 24 4
gpt4 key购买 nike

对于小型社区讨论,您使用了哪些基本的 Visual Studio 宏?

我刚刚开始了解它们,想听听你们中的一些人离不开什么。

最佳答案

我在工具栏上添加了以下 3 个宏的按钮。每个都将获取任何文件中当前选定的文本并用谷歌搜索(或 MSDN-it 或拼写检查)。为工具栏制作一个漂亮的图标以获得额外的风格点。

Private Const BROWSER_PATH As String = "C:\Program Files\Mozilla Firefox\firefox.exe"

Sub SearchGoogle()
Dim cmd As String
cmd = String.Format("{0} http://www.google.com/search?hl-en&q={1}", BROWSER_PATH, DTE.ActiveDocument.Selection.Text)
Shell(cmd, AppWinStyle.NormalFocus)
End Sub

Sub SearchMSDN()
Dim cmd As String
cmd = String.Format("{0} http://www.google.com/search?hl-en&q={1}+site%3Amsdn.microsoft.com", BROWSER_PATH, DTE.ActiveDocument.Selection.Text)
Shell(cmd, AppWinStyle.NormalFocus)
End Sub

Sub SpellCheck()
Dim cmd As String
cmd = String.Format("{0} http://www.spellcheck.net/cgi-bin/spell.exe?action=CHECKWORD&string={1}", BROWSER_PATH, DTE.ActiveDocument.Selection.Text)
Shell(cmd, AppWinStyle.NormalFocus)
End Sub

关于visual-studio - 很棒的 Visual Studio 宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/523220/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com