Guten Morgen allerseits!
Ich habe folgendes Problem:
Ich sollte eine Mail erstellen, in welcher der User eine Website durch Klick auf einen Textlink oder Button aufrufen kann. Diese Seite muss zwingend in einem externen Internet Explorer-Fenster geöffnet werden. Unsere Mitarbeiter können aber ihren Webretriever unter den Location Settings selber einstellen. Diese Einstellungen sollten nicht verändert werden, bzw nach der URL-Öffnung erhalten bleiben.
Als Notes-Neuling habe ich einen Button in der Mail folgendermassen verunstaltet:
| Sub Click(Source As Button) |
| |
| Dim str_URL As String |
| str_URL = "www.google.ch" |
| |
| |
| Dim session As NotesSession |
| Dim strLocation As String |
| Dim intComma As Integer |
| Dim dbNAB As NotesDatabase |
| Dim viewLocations As NotesView |
| Dim docLocation As NotesDocument |
| Dim item As NotesItem |
| Dim int_oldbrowser |
| |
| Set session = New NotesSession |
| strLocation = session.GetEnvironmentString("Location",True) |
| intComma = Instr(strLocation, ",") |
| strLocation = Left$(strLocation, intComma-1) |
| Set dbNAB = session.GetDatabase("", "names.nsf") |
| Set viewLocations = dbNAB.GetView("Locations") |
| Set docLocation = viewLocations.GetDocumentByKey(strLocation) |
| int_oldbrowser = docLocation.GetItemValue( "WebRetriever" ) |
| If (docLocation.WebRetriever(0) <> "2") Then |
| Set item = docLocation.ReplaceItemValue("WebRetriever", "2") |
| Call docLocation.Save(True, False) |
| End If |
| Set notesUIWorkspace = New NotesUIWorkspace |
| Call notesUIWorkspace.URLOpen(str_URL) |
| Set item = docLocation.ReplaceItemValue("WebRetriever", int_oldbrowser) |
| Call docLocation.Save(True, False) |
| |
| End Sub |
Meine Überlegung kurz erläutert:
- Zuerst sollte die alte Einstellung in der Variable
"int_oldbrowser" gespeichert werden.
- Dann mit
"Set item = docLocation.ReplaceItemValue("WebRetriever", "2")" auf den externen IE einstellen.
- Dann mit
"Call notesUIWorkspace.URLOpen(str_URL)" die Website öffnen.
- Alte Einstellung wieder einstellen:
"Set item = docLocation.ReplaceItemValue("WebRetriever", int_oldbrowser)"Leider klappt das ganze nicht so, wie ich will. Die Einstellungen werden zwar übernommen, jedoch anscheinend zu spät. Der Link öffnet weiterhin innerhalb von Notes.
Was mache ich falsch?
mfg
Michael