Consulting

Results 1 to 2 of 2

Thread: Hyperlink issue

  1. #1
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location

    Hyperlink issue

    If I use a shell command to open a mailmerge document, things are OK.
    [VBA]Call Shell("c:\program files\microsoft office\office\winword.exe C:\Database\val\Letter2.doc", 1)
    [/VBA]
    If I use a hyperlink to the same document,
    [VBA]Application.FollowHyperlink "C:\Database\val\Letter2.doc"
    [/VBA]
    the following message appears when I return to Access (the mailmerge etc. all function properly). Any ideas?
    MD

    Run-time Error 261
    An unexpected error has occurred.

  2. #2
    VBAX Regular
    Joined
    Jun 2005
    Posts
    87
    Location
    Is this a button on a switchboard? If so, you can do something like this in your switchboard:
    [VBA] Case 1
    Dim oApp2 As Object
    Set oApp2 = CreateObject("Word.Application")
    oApp2.Documents.Open "C:\Database\val\Letter2.doc"
    oApp2.Visible = True
    [/VBA]
    Last edited by xCav8r; 08-05-2005 at 10:35 PM. Reason: added vba tags

Posting Permissions

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