excel - VBA Email with pasted chart and text in body -
the goal of following code paste selected chart email body below text. however, continues paste above text. how can change make paste below? thanks!
set outapp = createobject("outlook.application") set outmail = outapp.createitem(0) outmail .cc = "xyz@anc.com" .bcc = "abc@xyz.com" .subject = "test" .body = "dear" & "macro " activesheet.range("p36:x46").copy set weditor = outapp.activeinspector.wordeditor weditor.application.selection.paste .display
change selection start , end. adding line break might idea. should use mailitem.getinspector instead of application.activeinspector since message not yet displayed.
set outapp = createobject("outlook.application") set outmail = outapp.createitem(0) outmail .cc = "xyz@anc.com" .bcc = "abc@xyz.com" .subject = "test" .body = "dear" & "macro " & vbcrlf activesheet.range("p36:x46").copy set vinspector = outmail.getinspector set weditor = vinspector.wordeditor weditor.application.selection.start = len(.body) weditor.application.selection.end = weditor.application.selection.start weditor.application.selection.paste .display
Comments
Post a Comment