Unqualified URLs and Import from RTF
Posted: Mon Dec 12, 2005 8:43 pm
Hi Sergey,
Let's say I have an RTF file with 2 hyperlinks that have the following target URLs:
http://www.google.com
www.google.com
The relevant portion of the RTF file looks like this:
\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 {\field{\*\fldinst HYPERLINK "http://www.google.com"}{\fldrslt \plain \f0\ul\fs20\cf2 One}} \par
\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 {\field{\*\fldinst HYPERLINK "www.google.com"}{\fldrslt \plain \f0\ul\fs20\cf2 Two}}
When I import this using InsertRTFFromFileEd(), I get the following:
http://www.google.com
C:\Program files\Whatever\Directory\The\RTF\File\Was\In\www.google.com
When the OnReadHyperlink() event is triggered, the Target parameter is already fully qualified with the wrong/inappropriate path, so it's somewhat tricky for me to fix this reliably in there.
I noticed the following:
Word 97 suffers from this problem, but to a lesser degree: the imported link is not qualified in the document itself, but the Hint it displays when the mouse hovers over the link is incorrectly qualified.
Word 2003 seems to have fixed this problem.
What do you think? I hope it's not a "feature"...
Thank you,
Michel
Let's say I have an RTF file with 2 hyperlinks that have the following target URLs:
http://www.google.com
www.google.com
The relevant portion of the RTF file looks like this:
\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 {\field{\*\fldinst HYPERLINK "http://www.google.com"}{\fldrslt \plain \f0\ul\fs20\cf2 One}} \par
\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 {\field{\*\fldinst HYPERLINK "www.google.com"}{\fldrslt \plain \f0\ul\fs20\cf2 Two}}
When I import this using InsertRTFFromFileEd(), I get the following:
http://www.google.com
C:\Program files\Whatever\Directory\The\RTF\File\Was\In\www.google.com
When the OnReadHyperlink() event is triggered, the Target parameter is already fully qualified with the wrong/inappropriate path, so it's somewhat tricky for me to fix this reliably in there.
I noticed the following:
Word 97 suffers from this problem, but to a lesser degree: the imported link is not qualified in the document itself, but the Hint it displays when the mouse hovers over the link is incorrectly qualified.
Word 2003 seems to have fixed this problem.
What do you think? I hope it's not a "feature"...
Thank you,
Michel