Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: hyperlink fields (word97sr2)

    Consider using the Hyperlinks collection object instead of the fields object:
    <pre>
    strText = "The Project Manager Was Fired in the First Round
    of Budget Cuts.doc"
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: hyperlink fields (word97sr2)

    > Consider using the Hyperlinks collection object instead of the fields object:

    Can't, really. The application is switchable between

    (1) building a document formed from Hyperlinks (from which we can make a web site with a single CLICK and
    (2) building a document of included text, from which we can publish (as a single document) a colelction of documents.


    For that reason (and maybe others down the road) i wanted to use a single procedure called strInsertField(intFieldType as Integer, ...) to do the slave work.


    >Was that snidley enough?

    No. Snide is "insinuatingly", and you barged right in.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hyperlink fields (word97sr2)

    As far as I can see the VBAer would be wise always to enclose field-text in a double-quote string.

    Here's me trying to insert a Hyperlink field, and suddenly I start to run into long filenames such as "Are you a great project manager.doc" (Kev, this is your cue for a snide remark or two ...)

    The Hyperlinks refuse to work.

    Investigation reveals that in the code below, the value of strfieldtext is as shown here from the debug window

    <pre>?strfieldtext
    d:GREAVESTRAININGManagementProjectsAre you a great project manager.doc
    </pre>


    Here's the line of code that USED to insert a hyperlink:
    <pre>Selection.Fields.Add Range:=Selection.Range, Type:=intLinkType, _
    Text:=strFieldText
    </pre>


    And here's what it used to try to get away with:
    <pre>d:GREAVESTRAININGManagementProjectsAre
    </pre>



    I have added a double-quote at the start and end of the text string:
    <pre>Selection.Fields.Add Range:=Selection.Range, Type:=intLinkType, _
    Text:="""" & strFieldText & """"
    </pre>


    And now am rewarded with:
    <pre>d:GREAVESTRAININGManagementProjectsAre you a great project manager.doc
    </pre>


    Edited by Charlotte to eliminate horizontal scolling

Posting Permissions

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