Я пытаюсь использовать этот код, чтобы получить выделенный текст в перспективе 2003Макрос VBA, чтобы получить выделенный текст в Outlook, 2003
Sub SelectedTextDispaly()
On Error Resume Next
Err.Clear
Dim oText As TextRange
''# Get an object reference to the selected text range.
Set oText = ActiveWindow.Selection.TextRange
''# Check to see whether error occurred when getting text object
''# reference.
If Err.Number <> 0 Then
MsgBox "Invalid Selection. Please highlight some text " _
& "or select a text frame and run the macro again.", _
vbExclamation
End
End If
''# Display the selected text in a message box.
If oText.Text = "" Then
MsgBox "No Text Selected.", vbInformation
Else
MsgBox oText.Text, vbInformation
End If
End Sub
При выполнении этого макроса я получаю ошибку
---------------------------
Microsoft Visual Basic
---------------------------
Compile error:
User-defined type not defined
Нужно ли добавлять какие-либо ссылки, чтобы исправить это?
(только пробовал в перспективе 2010 года) –