2 回答

TA貢獻1827條經驗 獲得超4個贊
要根據需要傳遞命令行參數,您必須切換到“啟動外部程序”下
項目屬性 --> 選項卡“調試” --> 部分“啟動操作”
然后使用“瀏覽”按鈕填寫您希望啟動的所需外部程序,在這種情況下是 Power Point 的路徑,或者只需鍵入/粘貼它。
然后在下面的文本框中填寫命令行參數。
筆記
這僅在使用 AddIn 項目時才需要,因為它們的啟動例程與“正常”窗口/控制臺應用程序不同。有了這些,“啟動項目”將正確尊重命令行參數。
AddIn 項目在其項目文件中有這樣的內容:
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{xxxxx}">
<ProjectProperties HostName="PowerPoint" HostPackage="{xxxxx}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="PowerPoint" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\15.0\Word\InstallRoot\Path#POWERPNT.EXE" DebugInfoCommandLine="/x" AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />
<Host Name="PowerPoint" GeneratedCodeNamespace="PowerPointAddIn" IconIndex="0">
<HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
</Host>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
您可以將所需的命令行參數傳遞給該值,DebugInfoCommandLine="/x"然后在使用“啟動項目”時傳遞這些參數。
- 2 回答
- 0 關注
- 129 瀏覽
添加回答
舉報