Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Location
    London, Kent, England
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hyperlink Problem (97 )

    I have table 'Documents', first field is 'Doc' second is 'Hyperlink'

    eg:

    How to Play Chess , C:My DocumentsHow_to_Chess.doc

    I have a subreport that decides which documents to display (there are hundreds)

    How can I either :-

    A ) Make it so when i click on a document description it forces the hyperlink in the second field. and the document is displayed



    or

    [img]/forums/images/smilies/cool.gif[/img] Add a button that does the same


    Regards

    Steve

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink Problem (97 )

    Steve,

    If they are all Word docs, then it's relatively easy for the code behind a command button:
    <pre>Private Sub CommandButton1_Click()

    dim objWord as Word.Application

    set objWord = CreateObject("Word.Application")

    objWord.Document.Open txtHyperlink.Text

    objWord.Visible

    set objWord = Nothing

    End Sub
    </pre>


    You will need to add a reference to Microsoft Word 8.0 Object Library from Tools|References
    as well.

    txtHyperlink is the textbox on the for that holds the full path to the document.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    New Lounger
    Join Date
    Jul 2002
    Location
    London, Kent, England
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink Problem (97 )

    ack.. some are excel files [img]/forums/images/smilies/sad.gif[/img]

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink Problem (97 )

    OK.

    I guess you'll need to use the ShellExecute API

    Have a look at post 166218

    It should help.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #5
    New Lounger
    Join Date
    Jul 2002
    Location
    London, Kent, England
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink Problem (97 )

    Thanks Carbonnb... Will do now

Posting Permissions

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