Outlook VBA Multiple Email Selections -
i trying pull information selection having no luck. here code singleitem cannot tow work selected items:
function getcurrentitem() object dim objapp outlook.application set objapp = application on error resume next select case typename(objapp.activewindow) case "explorer" set getcurrentitem = objapp.activeexplorer.selection.item(1) case "inspector" set getcurrentitem = objapp.activeinspector.currentitem end select set objapp = nothing end function how turn use selection of emails?
second half dimitry:
sub process_email(omail mailitem) dim mailsubject$ mailsubject = lcase(trim(omail.subject)) if mailsubject = "subject 1" call extract_and_export_1(omail.body) elseif mailsubject = "subject 2" call extract_and_export_2(omail.body) elseif instr(1, omail.body, "body field one", vbtextcompare) > 0 call extract_and_export_5(omail.body) end if end sub
your function declared return single item. how can return multiple items it?
in case of explorer, loop through items in selection collection:
select case typename(objapp.activewindow) case "explorer" each item in objapp.activeexplorer.selection msgbox item.subject next
Comments
Post a Comment