复制帮助中的示例代码

您有时可能想要从 Visual Basic 帮助复制有用的示例。 许多示例要求更多代码正确工作,而一些示例对了解特定过程或控制流技术的行为方式非常有用。

将示例代码从"帮助"复制到应用程序

  1. 使用"帮助"显示您想要使用其示例的语言元素的主题。

  2. 在页面顶部附近的非滚动区域中选择示例链接。 将显示代码示例。

  3. 右键单击并选择要复制到应用程序的代码部分。 On the Macintosh, choose Copy from the Edit menu; a window appears in which you can select the code to copy.

  4. Choose Copy from the shortcut menu. On the Macintosh, press the Copy button.

  5. Move the focus back to the Code window and position the mouse pointer where you want the code example to be inserted.

  6. Right-click again and choose Paste to insert the code example into the Code window.

    提示

    You can also press CTRL+C to copy a selected example in a Help window. Press CTRL+V to paste the example into the Code window.

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。