Question for Windows wizards VBA/VBScript  
Author Message
duck thing





PostPosted: Visual Basic for Applications (VBA), Question for Windows wizards VBA/VBScript Top

[Mods: please feel free to move this to another forum if necessary.]

I noticed today while helping a co-worker debug a piece of VBScript that the IIf() function doesn't seem to be implemented in VBScript. Specifically, the function always returns Empty when called. Replacing the IIf(condition,true,false) with an If... Then... Else statement fixes the problem, but I'm curious about why this is so.

My theory is this: The parent application's (in this case, Outlook's) VBScript object is created as a COM object. The pointer to "IIf()" is one of many function pointers returned by the IUnknown::QueryInterface() method. However, since the VBScript object in question doesn't support IIf(), the COM object's implementation of IIf() simply returns something like E_NOTIMPLEMENTED.

Is this more or less accurate Much appreciated, Windows gurus!




Microsoft ISV Community Center Forums1  
 
 
duck thing





PostPosted: Visual Basic for Applications (VBA), Question for Windows wizards VBA/VBScript Top

I apologize for bumping an unanswered thread, but I suspect somebody here must know the answer. If not, that's cool too As I said, I already found a workaround for this issue, so I'm not losing any sleep over it, but I am curious.