Please, could you write down the needed steps that I have to do in order
to
realize the mentioned problem?
Do you also have some examples in pseudo-code or (preferably) in real
code?
Thanks again
Private Sub Command1_Click()
Dim objWP As Object 'Object for WordPerfect
Dim SelText As String 'The variable for the selected text
'create the Wp Object
Set objWP = CreateObject("WordPerfect.PerfectScript")
'OLE command to extract the selected text
SelText = objWP.EnvSelectedText
'Display statements to see if it worked
If SelText = "" Then
MsgBox "You didn't select anything"
Else
MsgBox "You selected " & SelText
End If
'Cleanup (this is important)
objWP.quit
Set objWP = Nothing
End Sub
It's really pretty easy. Most of the other OLE commands are similar. Hope
this helps.
I just started with the OLE Command Inserter from the SDK - Well worth
installing.
But a (very) simple (untested) Delphi procedue to read the selected text
would look like the following:
// required ComOBJ in Uses clause (from memory...)
function ReadSelectedText : String;
var
objWP : Variant;
sTextReadFroMWP9 : string;
begin
objWP := CreateOleObject( 'WordPerfect.PerfectScript');
sTextReadFromWP9 := objWP.EnvSelectedText;
objWP.Quit;
objWP := UnAssigned;
ReadSelectedTExt := sTextReadFromWP9;
end;
Regards
-----------[Trevor Campbell]--------------------------------------------
Bekkers IT Perth Western Australia
t...@bekers.com.au
Replies to newsgroup only please unless requested.
Unsolicited e-mails will be deleted without being read.
----------------------------------------------------------------------------
------
Casper van der Tuin <in...@c-content.nl> wrote in message
news:39EEF63F...@c-content.nl...