This is about the second time in my life when pasted code for a new technique has worked first off.
I've had a cuppa and a lie down and am recovered now.
Question 1: Where has this been all my (VBA) life? I've been using Dictionaries for about 5 years to chat between Word & Excel. This article includes the nostalgic text " ... you would typically use the ToolsMacro WordBasic command."
Question 2: Who else (of you) is using this DDE technique between Word & Excel?
Question 3: Known traps for young players?
Word 2003 VBA:
Code: Select all
Sub Test (iNum As Integer)
MsgBox "The value is: " & iNum
End Sub
Sub Test2 (strFname As String, strLname As String, iNum As Integer)
MsgBox "The values are: " & strFname & "," & strLname & "," & iNum
End Sub
Code: Select all
Sub DDEtoWord()
Dim chanNum As Variant
chanNum = DDEInitiate("WinWord", "System")
DDEExecute chanNum, "[DDETesting.Test(5)]"
DDEExecute chanNum, "[DDETesting.Test2(""John"",""Doe"", 12)]"
DDETerminate chanNum
End Sub