LinkItem Property

See AlsoV9DOA4              Example1JCYFIL>Low

Applies To

Label3MNIZ8D, picture box31MYIWX, text boxYPYZDG.


Specifies the data passed to a destinationHF8UZ8 control in a DDEDEFDDE conversation with another application; corresponds to the item argument in the standard DDE syntax, with application, topic, and item as arguments.


[form.]{ label|picturebox|textbox}.LinkItem[ = stringexpression ]


To set this property, specify a recognizable unit of data in an application as a referencefor example, a cell reference such as "R1C1" in Microsoft Excel.

Use LinkItem in combination with the LinkTopicEVWV3S property to specify the complete data link for a destination control to a sourceO9K12R application.  To activate this link, set the LinkModeM1RK6S property.

You set LinkItem only for a control used as a destination.  When a Visual Basic form is a source in a DDE conversation, the name of any label, picture box, or text box on the form can be the item argument in the application|topic!item string used by the destination.  For example, the syntax:  =VizBasicApplication|MyForm!TextBox1 represents a valid reference from Microsoft Excel to a Visual Basic application.  You would enter this syntax for a destination cell in the Microsoft Excel formula bar.

Avoiding infinite loops  A DDE control can potentially act as destination and source simultaneously, causing an infinite loop if a destination-source pair is also a source-destination pair with itself.  For instance, a text box may be both a source (through its parent form) and destination of the same cell in Microsoft Excel.  When data in a Visual Basic text box changes, sending data to Microsoft Excel, the cell in Microsoft Excel changes, sending the change to the text box, and so on, causing the loop.

To avoid such loops, use related but not identical items for destination-source and source-destination links in both directions between applications.  For example, in Microsoft Excel, use related cells (precedents or dependents) to link a worksheet with a Visual Basic control, thus avoiding using a single item as both destination and source.  You should document any application|topic pairs you establish if you include a Paste Link command1XCTDGS for run-time use.


Note   Setting a permanent data link at design time with the Paste Link command from the Edit menu also sets the LinkMode, LinkTopic, and LinkItem properties.  This creates a link that is saved with the form.  Each time the form is loaded, Visual Basic attempts to reestablish the conversation.


Data Type


See Also


Creating a DDE Source or Destination LinkJ8NEMT

LinkSend MethodH24SKI

LinkMode PropertyM1RK6S

LinkTopic PropertyEVWV3S



Programmer's Guide:

Chapter 20, "Communicating with Other Applications"