Save Outlook attachment VBA does not work properly -
i try run code, not save xml file given folder. wrong it?
public sub saveattachtodisk(itm outlook.mailitem) dim objatt outlook.attachment dim savefolder string dim dateformat string dateformat = format(now, "yyyy-mm-dd h-mm") savefolder = "c:\users\gabor\documents\cafm\xml\" each objatt in itm.attachments if instr(objatt.displayname, ".xml") objatt.saveasfile savefolder & "\" & objatt.displayname end if set objatt = nothing next end sub
from comment "changing security settings solved problem. had set macro settings enable macro." – vergab jul 28 @ 20:09
Comments
Post a Comment