Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

[RESOLVED] Stop / Starting Outlook via VBScript

$
0
0
I can STOP Outlook nicely, but why is it so damn hard to get it up running again !

This snip of code says Outlook is already in use .... and it is NOT - I've seen it stop by stepping through the code !

Code:

Set objOutlook = CreateObject("Outlook.Application")
objOutlook.Quit
.
(some more code for copying !)
.
.
.

Msgbox "Start Outlook again !"
OpenOutlook
 

Sub OpenOutlook()

  Dim oApp
  Dim oName
  Dim oFolder

  Set oApp = CreateObject("Outlook.Application")
  Set oName = oApp.GetNamespace("MAPI")
'  OName.Logon "Default Outlook Profile",, False, True
'  Set oFolder = oName.GetDefaultFolder(6)
'  oFolder.Display
  OApp.ActiveExplorer.Activate

  Set oApp = Nothing
  Set oName = Nothing
  Set oFolder = Nothing

End Sub

What do I do wrong ?

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>