Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exchange Data with other application PART II

2 views
Skip to first unread message

Casper van der Tuin

unread,
Oct 19, 2000, 3:00:00 AM10/19/00
to
Thanks a lot for your last reactions Mark and Trevor!!!

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


Mark Allred

unread,
Oct 19, 2000, 3:00:00 AM10/19/00
to
Here is a quick and dirty routine in VB that displays the selected text

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.

Trevor Campbell

unread,
Nov 28, 2000, 3:00:00 AM11/28/00
to
Sorry for the delay replying Casper

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...

0 new messages