Results 1 to 1 of 1

a small problem with setting a hyperlink in a text

Threaded View

  1. #1
    Registered User
    Join Date
    06-16-2008
    Posts
    32

    a small problem with setting a hyperlink in a text

    Hello again.

    I've a small problem again...

    I'm now testing my macros in office 2007 and there's a strange problem

                With .TextFrame.TextRange.Characters(id_begin, id_length) 'selecting the part where IdString is
                With .ActionSettings(ppMouseClick).Hyperlink 'Adding the hyperlink
                            .Address = HyperlinksTable(i)
                            .SubAddress = ""
                            .ScreenTip = ""
                            .TextToDisplay = IdTable(i)
                End With
                End With
    That code works perfectly in office2k3, but in 2k7, the hyperlink appears in the beginning of the text.

    I'll explain the variables a bit

    'Hyperlinkstable' contains the hyperlink to be added
    'idtable', contains the text to be shown with the hyperlink
    id_begin contains the starting index number where to add the hyperlink (it comes from total_length -id_length [ where total length is textbody and id_length is the length of the name of the hyperlink])

    example:

    textbody = "aaaabbbbcccc", length 12
    id_string = "00001111", length 8
    total_length = 20
    id_begin = 12
    id_length = 8

    in 2003 version, my code puts the link in the 00001111
    but in 2007 it goes in aaaabbbb

    Hope you understand.

    Thanks.


    Solved by myself

    Just had to remove row ".TextToDisplay = IdTable(i)"
    Last edited by gummi; 12-15-2008 at 11:48 AM. Reason: solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1