向应用程序发送数据。
expression.DDEPoke(Channel, Item, Data)
expression 可选。该表达式返回一个 Application 对象。
Channel Long 类型,必需。用 DDEInitiate 方法返回的通道号。
Item Variant 类型,必需。数据被发送到的项。
Data Variant 类型,必需。发送到应用程序的数据。
如果本方法调用失效将产生错误。
本示例打开到 Word 的通道,打开 Word 文档“Sales.doc”,然后将工作表 Sheet1 上 A1 单元格的内容插入到该文档的开头。
channelNumber = Application.DDEInitiate( _
app:="WinWord", _
topic:="C:\WINWORD\SALES.DOC")
Set rangeToPoke = Worksheets("Sheet1").Range("A1")
Application.DDEPoke channelNumber, "\StartOfDoc", rangeToPoke
Application.DDETerminate channelNumber