Article ID: 106238
Article Last Modified on 12/9/2003
Project1|Form1!Text1
Caption Name Indent Level ------------------------------------ Edit mEdit 0 Copy mCopy 1 Paste mPaste 1 Paste Link mPasteLink 1
Const CF_TEXT = 1 Const CF_LINK = &HBF00
Sub mEdit_Click ()
mCopy.Enabled = Text1.SelLength > 0
mPaste.Enabled = Clipboard.GetFormat(CF_TEXT)
mPasteLink.Enabled = Clipboard.GetFormat(CF_LINK)
End Sub
Sub mCopy_Click ()
Clipboard.Clear
Clipboard.SetText Text1.SelText, CF_TEXT
Clipboard.SetText "Project1|Form1!Text1", CF_LINK
End Sub
Sub mPaste_Click ()
Text1.LinkMode = 0 ' discontinue previous link
Text1.SelText = Clipboard.GetText(CF_TEXT)
End Sub
Sub mPasteLink_Click ()
Dim topic As String ' app|topic!item
Dim bang As Integer ' index of ! within topic
topic = Clipboard.GetText(CF_LINK)
bang = InStr(topic, "!")
If bang <> 0 Then
Text1.LinkMode = 0
Text1.LinkTopic = Mid$(topic, 1, bang - 1)
Text1.LinkItem = Mid$(topic, bang + 1)
On Error Resume Next
Text1.LinkMode = 1 ' automatic
If Err <> 0 Then
MsgBox "Cannot paste link"
End If
End If
End Sub
Additional query words: docerr 3.00
Keywords: KB106238