johnworks
Goto Top

Outlook Marko: Fenster nebeneinander zeigen

Hallo Zusammen,


ich hatte vor mir ein kleines Makro zu schreiben was nachfolgendes Bewirkt:
1. Kalender öffnen:
Private Sub btnOutlookKalender_Click()

Dim objOutlook As Object
Dim objNameSpace As Object
Dim myCalendar As Object

Set objOutlook = CreateObject("Outlook.Application")  
Set objNameSpace = objOutlook.GetNamespace("MAPI")  
Set myCalendar = objNameSpace.GetDefaultFolder(9)

myCalendar.Display
    
 
'clean up  
Set objOutlook = Nothing
Set objNameSpace = Nothing
Set myCalendar = Nothing

End Sub

2. Webbrowser mit Webanwendung öffnen:
Private Sub btnBrowserUrl_Click()

URL = "https://administrator.de"  
CreateObject("Shell.Application").ShellExecute URL  

End Sub
3. beide Anwendungen in nebeneinander darstellen.

Hiebe habe ich in Outlook nur die Funktion zum minimieren und maximieren gefunden.
 Application.ActiveWindow.WindowState = olMinimized 

Hat jemand ein Snippet wie ich den Outkalender links und den Webbrowser rechts darstellen kann?

Vielen Dank!

Gruß John

Content-Key: 346857

Url: https://administrator.de/contentid/346857

Printed on: April 24, 2024 at 22:04 o'clock

Mitglied: 133883
133883 Aug 21, 2017 updated at 15:50:11 (UTC)
Goto Top
Das Explorer Object kennt die Eigenschaften Left,Top,width und height face-smile
https://msdn.microsoft.com/de-de/library/ff860356.aspx
Um den aktiven Explorer zu bekommen
https://msdn.microsoft.com/de-de/library/ff870017.aspx
IE Fenster anordnen
Aufruf einer Anwendung im Internet Explorer 11 mit ausgeblendeter URL

Fertig.

Grüß
Member: JohnWorks
JohnWorks Aug 22, 2017 at 08:05:46 (UTC)
Goto Top
Vielen Dank für deinen Ansatz.

Private Sub btnBrowserUrl_Click()

Dim objIE As Object

Set objIE = CreateObject("InternetExplorer.Application")  
With objIE
    .Addressbar = False
    .ToolBar = False
    .Navigate "https://administrator.de/"  
    While (.Busy)
        WScript.Sleep 100
    Wend
    .Width = .Document.parentWindow.screen.Width
    .Height = .Document.parentWindow.screen.Height
    .Left = 0
    .Top = 0
    .Document.Title = "BlaBla"  
    .Visible = True
End With
    
End Sub

Leider schlägt das Snippet fehl im While fehl: Laufzeitfehler 424.
Nehme ich das While raus kommt der nächste Fehler bei .Document.

Laufzeitfehler '-214747259 (80004005)': Die Methode 'Document' fpr das Objekt 'IWebBrowser2' ist fehlgeschlagen.

Vielleicht hat noch jemand einen Ansatz. Vielen Dank!
Mitglied: 133883
133883 Aug 22, 2017 at 09:14:10 (UTC)
Goto Top
Hier läuft's problemlos!
Member: JohnWorks
JohnWorks Aug 22, 2017 at 11:52:24 (UTC)
Goto Top
Hast Du es einfach als Makro in ThisOutlookSession eingefügt?
Ich nutze Office 2016, Markoeinstellung alle deaktiviert.