Ich muss mich korrigieren. Lotus Notes befindet sich doch in der Citrix-Umgebung und nicht lokal.
Nun habe ich einmal einen kleinen Testagenten geschrieben, der nichts anderes macht als ein Worddokument, was in einem Verzeichnis liegt zu öffnen.
| Sub Initialize |
| Dim cs As New CCallStack("open word file") |
| Dim MSApplication As Variant |
| Dim MSDocument As Variant |
| Dim Directory As String |
| Dim Filename As String |
| Dim FullPath As String |
| |
| On Error GoTo ErrorHandle |
| Directory = "C:\temp\" |
| FileName = "TestDoc1.doc" |
| FullPath = Directory & "\" & FileName |
| MsgBox "Pfad: " & FullPath |
| Set MSApplication = CreateObject("Word.Application") |
| Set MSDocument = MSApplication.Documents.Open( FullPath ) |
| MsgBox("Datei wurde initiiert und wird einmal gespeichert.") |
| MSDocument.SaveAs (FullPath) |
| MSApplication.Quit |
| Sleep 2 |
| MsgBox("Word wurde geschlossen. Die Datei wird nun wieder geöffnet.") |
| Call ShellExecute (0, "open", FullPath,"", Directory + "\" , 1 ) |
| |
| Exit Sub |
| ErrorHandle: |
| Call logError() |
| Exit Sub |
| End Sub |
Beim Script-Debugging hat sich dann gezeigt, dass bei Set MSApplication kein Objekt zurückgeliefert wird.
Das Problem besteht möglicherweise darin, dass Office 2010 von Citrix 'gestreamt' wird.
Normalerweise ist es doch so, dass in der Registrierungsdatenbank ein Schlüssel hinterlegt ist, mit welcher Anwendung Dateien geöffnet werden sollen.
Da Office über Citrix gestreamt wird, fehlt in diesem Fall jedoch die Zuordnung.
Hat dazu vielleicht jemand Erfahrungen oder Tipps?