excel - Attachment on IE email -
i trying send email (using microsoft 365) attachments automating ie using excel vba, trying add attachments , getting confused. in microsoft 365 email attachment can added clicking on insert attachment in sub-menu or dragging file directly body of email. have tried autoumating clicking of insert reffering following html code object:
<button autoid="_mcp_8" type="button" class="_mcp_j1 ms-font-weight-regular includebutton o365button ms-font-color-neutralsecondary" tabindex="0" aria-label="insert" aria-haspopup="true" aria-disabled="true" aria-owns="_ariaid_118" aria-flowto="_ariaid_118"><span class="_fc_3 owaimg _mcp_l1 wf wf-size-x16 wf-owa-attachment wf-family-owa ms-font-color-neutralsecondary" role="presentation"></span><span class="_fc_4 o365buttonlabel _mcp_k1 _fc_2">insert</span></button>
but error, following html code attachment button under insert sub-menu:
<div tabindex="-1" class="_fce_b" aria-selected="false"><div autoid="_fce_1" class="o365button _fce_d ms-fwt-r ms-fcl-np" role="menuitem" tabindex="0" aria-label="insert attachment"><div class="_fce_g _fce_i"><span class="_fce_j owaimg" role="presentation" style="display: none;"></span><span autoid="_fce_4" aria-label="insert attachment">attachments</span></div></div></div> <div autoid="_fce_1" class="o365button _fce_d ms-fwt-r ms-fcl-np" role="menuitem" tabindex="0" aria-label="insert attachment"><div class="_fce_g _fce_i"><span class="_fce_j owaimg" role="presentation" style="display: none;"></span><span autoid="_fce_4" aria-label="insert attachment">attachments</span></div></div>
the code using in vba was:
ie.document.getelementsbyclassname("_mcp_j1 ms-font-weight-regular includebutton o365button ms-font-color-neutralsecondary")(0).click
since able drag , drop file body of email when manually think there may simpler alternative trying click buttons attach file. guidance on of methods appreciated.
Comments
Post a Comment