Custom URL Copy and Paste problem

General TRichView support forum. Please post your questions here
Post Reply
dimik78
Posts: 12
Joined: Wed Dec 29, 2010 12:48 pm

Custom URL Copy and Paste problem

Post by dimik78 »

Hi Sergey,

We have a problem with copy/paste custom URL protocol links generated by custom URI Scheme.
https://docs.microsoft.com/en-us/previo ... dfrom=MSDN

Custom link generated by our system in HTML format and look like
koper3:&OBJECT_LINK=659FFA4A-B844-4D3C-954E-87B253E3DAB4&firm=100100001530617&db=7777

Then we paste generated link from clipboard in TRichView all OK.
Then we paste generated link from clipboard in MS Word/Outlook all OK.
Then we copy link from TRichView and paste in MS programs or TRichView all OK.

But when we copy link from MS Word and try to paste in TRichView the link make broken.
Depending on which directory the file is in (for example "С:\"), the file path is added to the link and link look like
C:\koper3:&OBJECT_LINK=659FFA4A-B844-4D3C-954E-87B253E3DAB4&firm=100100001530617&db=7777

A big request for help to deal with this problem.
Test Word file with link in attachment.

Thank in advance.
Attachments
test.docx
(11.42 KiB) Downloaded 568 times
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Custom URL Copy and Paste problem

Post by Sergey Tkachenko »

TRichView does not recognize this link as URL, so it thinks that it is a relative path and adds a base path to it.

Solutions:

1) Assign RichViewEdit.RTFReadProperties.BasePathLinks = False.
In this mode, the editor never adds base path to links

2) Assign your function to RVIsCustomURL variable (defined in RVFileFuncs unit).
The function must be like this:

Code: Select all

type
  TCustomRVIsURLFunction = function(const Word: TRVUnicodeString): Boolean;
If Word contains your URL, this function must return True.
Post Reply