Application.DDETerminateAll method (Word)
Closes all dynamic data exchange (DDE) channels opened by Microsoft Word.
Syntax
expression. DDETerminateAll
expression A variable that represents an Application object. Optional.
Remarks
This method does not close channels opened to Word by client applications. Using this method is the same as using the DDETerminate method for each open channel.
If you interrupt a macro that opens a DDE channel, you may inadvertently leave a channel open. Open channels are not closed automatically when a macro ends, and each open channel uses system resources. For this reason, it is a good idea to use this method when you are debugging a macro that opens one or more DDE channels.
Example
This example opens the Microsoft Excel workbook Book1.xls, inserts text into cell R2C3, saves the workbook, and then terminates all DDE channels.
Dim lngChannel As Long
lngChannel = DDEInitiate(App:="Excel", Topic:="System")
DDEExecute Channel:=lngChannel, Command:="[OPEN(" & Chr(34) & _
"C:\Documents\Book1.xls" & Chr(34) & ")]"
DDETerminate Channel:=lngChannel
lngChannel = DDEInitiate(App:="Excel", Topic:="Book1.xls")
DDEPoke Channel:=lngChannel, Item:="R2C3", Data:="Hello World"
DDEExecute Channel:=lngChannel, Command:="[Save]"
DDETerminateAll
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기