Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Oct 30, 2023 11:26 pm

Hi Team,

After adding a TextBox with ShapeType.RoundRectangle, I need to append hyperlink to the whole thing, not just the text inside. Word uses the href attribute in the roundrect tag to do this (I'm using wordml format). If there is any way to set this parameter?

And one more feature that doesn't quite work correctly with application links. When I insert a link as follows:
Code: Select all
AppendHyperlink("myapp://offline/main? Base=STR;n=30482","some text", HyperlinkType.WebLink)

it goes to the next block in xml file:
Code: Select all
<w:instrText>HYPERLINK \l "http://myapp://offline/main?base=STR;n=30482"</w:instrText>

Which makes it stop working properly. If you set a similar link via Word, the following section will be added:
Code: Select all
<w:hlink w:dest="myapp://offline/main? Base=STR;n=30482">
   <w:r wsp:rsidR="00E9246B">
   <w:rPr>
      <w:rStyle w:val="a3"/>
   </w:rPr>
        <w:t>some text</w:t>
   </w:r>
</w:hlink>

Is it possible to repeat this behavior?

Thanks in advance

warlock9k
 
Posts: 3
Joined: Mon Oct 30, 2023 10:18 pm

Tue Oct 31, 2023 2:22 am

Hi,

Thanks for your inquiry.
Currently, our product does not support setting this parameter.
For your another issue, I have added the hyperlink, using the latest commercial version, but it works well, please see the following picture for reference.
result.png

In addition, I have checked the xml file, as shown below
xml.png

If you are not using the latest commercial version, please upgrade and have a test again, if the issue still exists, please share us with your code and document.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Tue Oct 31, 2023 1:34 pm

Your example also retains the error related to the link. When inserting the link, the library adds the http protocol and the original link breaks.
Input link:
myapp://offline/main?Base=STR;n=30482

Output link in file:
http:/myapp/offline/main?Base=STR;n=30482

warlock9k
 
Posts: 3
Joined: Mon Oct 30, 2023 10:18 pm

Wed Nov 01, 2023 3:39 am

Hi,

Thanks for your feedback.
I have misunderstood your issue before, you can specify the HyperlinkType as FileLink to ensure that the effect is consistent with Word.
result.png

If you have any other questions, just feel free to contact us. We are here to help you.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Wed Nov 01, 2023 12:54 pm

Thank you!

warlock9k
 
Posts: 3
Joined: Mon Oct 30, 2023 10:18 pm

Thu Nov 02, 2023 1:23 am

Hi,

Thanks for your reply.
If you have any other issues or concerns, just feel free to contact us, we are here to help you.

Have a nice day! :D

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc