home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "DDE Client to WinWord"
- ClientHeight = 3855
- ClientLeft = 1065
- ClientTop = 1485
- ClientWidth = 7365
- Height = 4260
- Left = 1005
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 3855
- ScaleWidth = 7365
- Top = 1140
- Width = 7485
- Begin Frame Frame1
- Caption = "Link Options"
- Height = 1335
- Left = 5280
- TabIndex = 6
- Top = 1680
- Width = 1815
- Begin OptionButton optManualLink
- Caption = "Manual link"
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 840
- Width = 1455
- End
- Begin OptionButton optAutoLink
- Caption = "Auto link"
- Height = 255
- Left = 240
- TabIndex = 7
- Top = 360
- Width = 1335
- End
- End
- Begin TextBox Text1
- Height = 975
- Left = 720
- MultiLine = -1 'True
- TabIndex = 0
- Top = 2040
- Width = 1815
- End
- Begin CommandButton Poke
- Caption = "Poke"
- Height = 375
- Left = 3120
- TabIndex = 1
- Top = 1680
- Width = 1695
- End
- Begin CommandButton request
- Caption = "Request"
- Height = 375
- Left = 3120
- TabIndex = 2
- Top = 2280
- Width = 1695
- End
- Begin Label Label4
- Caption = "Text1"
- Height = 255
- Left = 720
- TabIndex = 9
- Top = 1800
- Width = 495
- End
- Begin Label Label1
- Alignment = 2 'Center
- AutoSize = -1 'True
- BorderStyle = 1 'Fixed Single
- Caption = "This application links to a Word for Windows document: "
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 270
- Left = 600
- TabIndex = 3
- Top = 120
- Width = 5820
- End
- Begin Label Label2
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Word for Windows will be started and Text1 will be linked to the file SOURCE.DOC. That file must have a bookmark DDE_LINK."
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 855
- Left = 960
- TabIndex = 4
- Top = 600
- Width = 5175
- End
- Begin Label Label3
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Assumes c:\winword\winword.exe"
- Height = 255
- Left = 1920
- TabIndex = 5
- Top = 3360
- Width = 3255
- End
- Option Explicit
- Const NONE = 0 ' 0 - None
- Const LINK_SOURCE = 1 ' 1 - Source (forms only)
- Const LINK_AUTOMATIC = 1 ' 1 - Automatic (controls only)
- Const LINK_MANUAL = 2 ' 2 - Manual (controls only)
- Const LINK_NOTIFY = 3 ' 3 - Notify (controls only)
- Sub AutomaticLink_Click ()
- Request.Enabled = False
- Text1.LinkMode = NONE
- Text1.LinkMode = LINK_AUTOMATIC
- End Sub
- Sub Form_Load ()
- Dim rc As Integer
- rc = Shell("c:\winword\winword c:\vbdemos\dde\source.doc", 1)
- rc = DoEvents()
- Text1.LinkMode = NONE
- 'Be sure document is not maximized in Winword -
- 'Winword title bar should be Microsoft Word - NOT "Microsoft Word - Document1"
- Text1.LinkTopic = "WinWord|\vbdemos\dde\source"
- Text1.LinkItem = "dde_link"
- Text1.LinkMode = LINK_MANUAL
- optManualLink.Value = True
- End Sub
- Sub ManualLink_Click ()
- Request.Enabled = True
- Text1.LinkMode = NONE
- Text1.LinkMode = LINK_MANUAL
- End Sub
- Sub Poke_Click ()
- Text1.LinkPoke
- End Sub
- Sub Request_Click ()
- Text1.LinkRequest
- End Sub
-