Page 1 of 1
Enhance the Documentation with an example of DDE Insert
Posted: Wed Jul 14, 2004 4:17 am
by drefty
The textpad website says that text can be inserted into TextPad using DDE Insert, but there are no examples or explanation (that I can find) showing how to do this.
Please someone give a simple example of this, just a simple "hello world" from any DDE insert example would be a start.
DDE comunication with TextPad
Posted: Wed Aug 04, 2004 4:08 pm
by Martin Schniewind
In VB I created a tool wich does DDE communication with TextPad.
I created a form an set its LinkMode prperty to 1 (source).
I placed a label on the form, called "lblDDEsend" - you can also use a textbox instead.
In the forms code I put the following:
Code: Select all
With Me.lblDDEsend
.LinkMode = vbLinkNone
.LinkTopic = "Textpad|System"
.LinkMode = vbLinkManual
.LinkExecute "[command(Insert,""" & strInsertString & """)]"
.LinkMode = vbLinkNone
End With
This inserts the string contained in "strInsertString" at the current cursor position of the active document.
Unfortunately the current selection collapses before the insertion takes place. That means: whatever was highlighted in the active document is not going to be replaced by the insertet string, but the cursor first moves to the end of the selection.