2015-02-24 39 views
5

È possibile aggiungere un collegamento ipertestuale a una messagebox? Sto cercando di fare qualcosa di simile:Inserire un collegamento ipertestuale in un MessageBox

MsgBox "Sorry, but you have an out-of-date database version. Please redownload via the batch file to ensure that you have the latest version. Contact the administrator of this database or your manager if you need help." & vbCr _ 
     & vbCr _ 
     & "Your current database version is " & CurrentVer & " which may be out of date. The current database version prescribed on the network share is " & FileVer & ". They must match in order for you to proceed." & vbCr _ 
     & vbCr _ 
     & "For CSC self-help instructions on how to reload the most current version of the PRF Intake Tool to your computer, please click the link below to be directed to CSC Online instructions." & vbCr _ 
     & vbCr _ 
     & "http://www.OurSite.com/online/Solutions/Search_Results.asp?opsystem=7&keywords=PRF+Intake+Tool&Category=", , "There is a problem..." 

Il problema è che il collegamento ipertestuale non è selezionabile. Mi piacerebbe farlo in modo che gli utenti possano semplicemente fare clic sul collegamento e avviare automaticamente il download.

Sto utilizzando Access 2010 in un ambiente Win7.

+0

No, ma si potrebbe chiedere all'utente se volevano aprire il link e quindi navigare IE nella posizione, ad esempio. – Gareth

+3

o creare un modulo personalizzato per la messagebox e quindi aggiungere il collegamento ipertestuale – Sorceri

risposta

7

Una risposta diretta è NO. MsgBox non consente collegamenti ipertestuali, solo testo semplice.

Quindi, ecco una soluzione che dovrebbe funzionare bene.

Set objShell = CreateObject("Wscript.Shell") 

intMessage = MsgBox("Sorry, but you have an out-of-date database version. Please redownload via the batch file to ensure that you have the latest version. Contact the administrator of this database or your manager if you need help." & vbCr _ 
     & vbCr _ 
     & "Your current database version is " & CurrentVer & " which may be out of date. The current database version prescribed on the network share is " & FileVer & ". They must match in order for you to proceed." & vbCr _ 
     & vbCr _ 
     & "Would you like to learn more about CSC self-help instructions on how to reload the most current version of the PRF Intake Tool to your computer?", _ 
     vbYesNo, "There is a problem...") 

If intMessage = vbYes Then 
    objShell.Run ("http://www.OurSite.com/online/Solutions/Search_Results.asp?opsystem=7&keywords=PRF+Intake+Tool&Category=") 
Else 
    Wscript.Quit 
End If 

Se stile di sottolineatura è un requisito, allora si dovrebbe solo creare il proprio form utente come descritto a http://j-walk.com/ss/excel/tips/tip71.htm. Ecco i passaggi:

  1. aggiungere un oggetto Label e digitare il messaggio
  2. Rendere il Blue Label (ForeColor) e sottolineato (Font) in modo che si presenta come un collegamento ipertestuale tipico.
  3. Impostare la proprietà del Label MousePointer-99 - fmMousePointerCustom
  4. specificare il file del cursore per l'immagine del etichetta MouseIcon (se ne avete uno).
  5. Fare doppio clic sull'etichetta e creare una subroutine Fare clic su evento. Ecco un esempio di codice:

    Private Sub Label1_Click() 
        Link = "http://www.YOUR_SITE.com" 
        On Error GoTo NoCanDo 
        ActiveWorkbook.FollowHyperlink Address:=Link, NewWindow:=True 
        Unload Me 
        Exit Sub 
    NoCanDo: 
        MsgBox "Cannot open " & Link End Sub 
    

di creare una "mail a" collegamento ipertestuale, utilizzare una dichiarazione come questa:

Link = "mailto:[email protected]" 
+1

Grazie! Questo ha funzionato bene. –

+0

Questo risolutore è un problema totalmente non correlato per me .... Grazie –

Problemi correlati