R
rossini73
I have this code to create new folder under the inbox that works fine
in the vb editor in outlook.
Sub AddNewFolder()
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myNewFolder As Outlook.MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myNewFolder = myFolder.Folders.Add("test")
End Sub
I want to run this code from the command line with a .vbs or anything
that can be added to a login script. I tried running the following as
a vbs, no errors are reported but no folder is created either.
Sub AddFolder()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(6)
Set myNewFolder = myFolder.Folders.Add("test")
MsgBox "Test Folder Created"
End Sub
Any help from script/outlook pros would be appreciated, thanks.
in the vb editor in outlook.
Sub AddNewFolder()
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myNewFolder As Outlook.MAPIFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myNewFolder = myFolder.Folders.Add("test")
End Sub
I want to run this code from the command line with a .vbs or anything
that can be added to a login script. I tried running the following as
a vbs, no errors are reported but no folder is created either.
Sub AddFolder()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(6)
Set myNewFolder = myFolder.Folders.Add("test")
MsgBox "Test Folder Created"
End Sub
Any help from script/outlook pros would be appreciated, thanks.