Outlook 2013 using VBA to Send Drafts -
good morning,
using outlook 2010 compiled code send emails saved in drafts folder of given account. i've upgraded office 2013 getting error... .send bit falls on , presents error message:
"this method can't used inline response mail item."
i there v simple method sending drafts, have scoured web , can't figure yet.
public sub senddrafts() dim ldraftitem long dim myoutlook outlook.application dim mynamespace outlook.namespace dim myfolders outlook.folders dim mydraftsfolder outlook.mapifolder 'send items in "drafts" folder have "to" address filled 'setup outlook set myoutlook = outlook.application set mynamespace = myoutlook.getnamespace("mapi") set myfolders = mynamespace.folders 'set draft folder. need modification based on it's set mydraftsfolder = myfolders("accounts@credec.co.uk").folders("drafts") 'loop through draft items ldraftitem = mydraftsfolder.items.count 1 step -1 'check "to" address , send if "to" filled in. if len(trim(mydraftsfolder.items.item(ldraftitem).to)) ] 0 'send item mydraftsfolder.items.item(ldraftitem).send end if next ldraftitem 'clean-up set mydraftsfolder = nothing set mynamespace = nothing set myoutlook = nothing end sub
i know old, in case elses looking answer:
"active inline response" refers draft open in outlook. so, when debugging, close draft , flip different message. see if code run.
Comments
Post a Comment