diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c
index ca5e1d56f7a..a57f39e7872 100644
--- a/dlls/mshtml/htmlelemcol.c
+++ b/dlls/mshtml/htmlelemcol.c
@@ -419,11 +419,13 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
switch(V_VT(&name)) {
case VT_I4:
+ case VT_INT:
if(V_I4(&name) < 0)
return E_INVALIDARG;
hres = get_item_idx(This, V_I4(&name), pdisp);
break;
+ case VT_UI4:
case VT_UINT:
hres = get_item_idx(This, V_UINT(&name), pdisp);
break;
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 3e83e64bac7..077f6e23264 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2437,6 +2437,27 @@ static void _test_elem_collection(unsigned line, IUnknown *unk,
ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
+ V_VT(&name) = VT_UI4;
+ V_I4(&name) = len;
+ disp = (void*)0xdeadbeef;
+ hres = IHTMLElementCollection_item(col, name, index, &disp);
+ ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
+ ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
+
+ V_VT(&name) = VT_INT;
+ V_I4(&name) = len;
+ disp = (void*)0xdeadbeef;
+ hres = IHTMLElementCollection_item(col, name, index, &disp);
+ ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
+ ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
+
+ V_VT(&name) = VT_UINT;
+ V_I4(&name) = len;
+ disp = (void*)0xdeadbeef;
+ hres = IHTMLElementCollection_item(col, name, index, &disp);
+ ok_(__FILE__,line) (hres == S_OK, "item failed: %08x\n", hres);
+ ok_(__FILE__,line) (disp == NULL, "disp != NULL\n");
+
V_VT(&name) = VT_I4;
V_I4(&name) = -1;
disp = (void*)0xdeadbeef;