Enhance the Documentation with an example of DDE Insert

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
drefty
Posts: 35
Joined: Mon Dec 22, 2003 3:53 pm

Enhance the Documentation with an example of DDE Insert

Post 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.
Martin Schniewind
Posts: 1
Joined: Wed Aug 04, 2004 3:23 pm

DDE comunication with TextPad

Post 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.
Post Reply