Without a reference, VBA will not know about Outlook constants such as olTo
and olCC
. With late binding (no reference), you must supply the values for constants rather than the names of the constants.
However, since you didn't report a compile error about those constants, that suggests your code module does not include Option Explicit
in its Declarations section. Trying to troubleshoot VBA code without Option Explicit
is a waste of time.
Add Option Explicit
, then choose Debug->Compile from the VB Editor's main menu and fix anything the compiler complains about. Resume you troubleshooting afterward.