Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to start DDE between VB app. and Word ?

Status
Not open for further replies.

jackha18

Technical User
Sep 28, 2002
39
IL
until now i never used DDE to retrieve information from word. please, explain where can i find all the topics and commands can be used to communicate with word 2000 through DDE. i couldn't find any reference of it in msdn.
thanks.
 
i need a real time monitor of Word document contents. i already did it using timer which reads the contents via ole but with big document the massive data transfer 10 or 20 times per second consumes quite much resources. i want to try dde because i was told that dde can notify me when the data is being changed so i won't have to read it so frequently.
 
You're right - DDE may be the right approach. Since I know nothing about DDE, I might try a different approach: in Word, use event handlers that detect the kinds of changes you are looking for. When they occur, use Word VBA to change a cell on the Excel worksheet you are using to handle the Word changes, and in Excel have an event handler (Worksheet_Change) that detects the change and acts accordingly.

Dim xl As Excel.Application
Set xl = GetObject(, "excel.application")
xl.workbooks("WordHandler").sheets(1).range("A1")=1
set xl=nothing

will do the work inside Word. For this to work, Excel must be loaded and the "WordHandler" workbook must be open.
It works - how efficient this is relative to DDE I don't know.
Rob
[flowerface]
 
thanks, rob. hooking via excel is pretty interesting technique, unfortunately i can't use because my application will is used not only by myself. i can't force all the users to install excel, i'll just wait until somebody will through me a "DDE bone".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top