Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug? with MS Outlook typelib QM compiler syntax checking
#1
I'm trying to write a QM macro to open a sub-folder under the Outlook Inbox folder.
I'm getting a QM compiler syntax error for this code on the last line:
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.3
Outlook.Application app._getactive
Outlook.NameSpace ns=app.GetNamespace("MAPI")
Outlook.MAPIFolder f
Outlook.MAPIFolder fInbox=ns.GetDefaultFolder(Outlook.olFolderInbox)
f=fInbox.Folders("test")
> Error in openOutlookFolder: Expected 0 arguments, not 1.

This code works in VBscript:
Dim OutlookApp 'As Outlook.Application
Dim ns 'As NameSpace
Dim folder 'As MAPIFolder
dim olFolderInbox
olFolderInbox=6
Set OutlookApp = GetObject(, "Outlook.Application")
Set ns = OutlookApp.GetNamespace("MAPI")
Set folder = ns.GetDefaultFolder(olFolderInbox)
Set folder = folder.Folders("test")
Set OutlookApp.ActiveExplorer.CurrentFolder = folder

The VBscript code has no type checking.

QM prompts (at the bottom left of the editor screen) that the fInbox.Folders() accepts no parameters, but passing a parameter to .Folders() works at runtime in the VBscript code.

Maybe the Outlook typelib information is not accurate.
How can I disable compile-time syntax checking and catch any error at runtime?
Thanks for any help you can offer,
John


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)