How To Copy An Excel Range To Outlook Using VBA

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024

Комментарии • 51

  • @elzbietadrogomirecka351
    @elzbietadrogomirecka351 3 года назад +1

    Fantastic tutorial - clear, informative and very very helpful.
    Thank you!

  • @VisionNaturelle
    @VisionNaturelle 2 года назад

    Thank you so much for this video. So clear and easy to follow. I was losing the will with excel.

  • @linawinny3743
    @linawinny3743 4 года назад +7

    Hi, thanks to this one which I need now. but what is owdEditor. is it variable? because I get the debug that variable not define.

  • @devendranpillaiperumal1178
    @devendranpillaiperumal1178 4 года назад

    This thing works like magic. Thank you very much

  • @sorinm221
    @sorinm221 2 года назад

    This is an awesome tutorial! Life saver.

  • @alvaromartinez758
    @alvaromartinez758 4 года назад +4

    Can we add the signature after pasting the picture??

  • @zh8078
    @zh8078 4 года назад +3

    great code. i am encountering an error at the "get word inspector" portion of the code and receiving a run time error 287 application defined or object defined error. i checked every line of code against yours and cant seem to find the issue. i made sure to add the relevant references; is it possible my employer has some functionality restrictions with outlook?

  • @rubyjanebalancio2057
    @rubyjanebalancio2057 4 года назад +1

    This is very helpful! Thank you

  • @charliearmour1628
    @charliearmour1628 5 месяцев назад

    Excellent, thank you.

  • @wannabe_quant6852
    @wannabe_quant6852 4 года назад

    hey, I have a quick query. Say we have selected the WordEditor, then specified a range by getting the ActiveDocument's Content. The oWrdRng.Collapse Direction:=wdCollapseEnd bit is equivalent to what if we did the same thing either with the keyboard or the mouse? For example .Paragraphs.Add, I presume is similar to hitting enter so, to add to this .InsertBreak corresponds to what action?
    we have just added a paragraph why dont we just paste there?
    Lastly, why do you use the "oWdEditor" variable-object although we have already specified the word editor via oLookIns.WordEditor hence use the oWrdDoc instead of oWdEditor?
    Sorry for the lengthy queries and thank you for the video. :)

  • @jiturane8232
    @jiturane8232 4 года назад +3

    Can we add signature after paste body mail ??

  • @asystman
    @asystman 4 года назад +1

    Is there any reason why the .Display option works perfectly well, whereas in the .Send option only the " " part appears in the email? The part which has been copied from excel is missing completely.

    • @SigmaCoding
      @SigmaCoding  4 года назад

      I think it has something to do with the fact that when you call the "Display" method it returns an Inspector object. The inspector object is what we use to access the "WordEditor" property which is used to paste the content. What you could do, if you don't want to display it, is to use the "GetInspector" property to return the MailItem Inspector.

  • @Alucard0831
    @Alucard0831 3 года назад +1

    Any way I can paste the copied range between bodies of text?

  • @petardzopalic3220
    @petardzopalic3220 9 месяцев назад

    HI thank you for tutorial.
    how to paste not like a picture , I would like to paste it like range .

  • @danielwagner1696
    @danielwagner1696 3 года назад

    Hi, thanks a lot for this video. really helpful. Have a q when I want to copy larger ranges that might need landscape format in a word or outlook. Cause when I did that with above code and used "SetExcRng = Selection.SpecialCells(xlCellTypeVisible) it cuts off half of the pasted picture). Is there a solution to this? Thanks in advance.

  • @fahrrent
    @fahrrent Год назад

    Hi, i have a minor problem with your codes,
    Its not automatically pasting on outlook, i have press ctrl +v to paste is on email,
    Any solution?😊

  • @jacobruiz1671
    @jacobruiz1671 3 года назад

    The image pastes below my signature, how do I make it so the image pastes above the signature in the body?

  • @frantzbernier3792
    @frantzbernier3792 Год назад

    Thank you, it works fine. Is it possible to add/keep a default signature?

  • @SQ-kk8qt
    @SQ-kk8qt 2 года назад

    Thanks! Is that possible to add a signature at the bottom of the email?

  • @michellelee8481
    @michellelee8481 4 года назад

    Do you have a macro code for sending email from Excel to IBM Notes instead?

  • @nurfarzanaosman3072
    @nurfarzanaosman3072 3 года назад

    Hi Thank you very much. It works. But why its not display the right range set as in the code? 2 column at the end is not displaying in the outlook. Hope u can help.

    • @nurfarzanaosman3072
      @nurfarzanaosman3072 3 года назад

      i use this code oWrdRng.Paste instead. It display all column i wanted to paste. But i don't want it to be display as normal table.

  • @trevormcintosh582
    @trevormcintosh582 4 года назад

    Hi, an extra code that can be added to make the picture wider, so it takes up more of the mail window?

    • @captainka67
      @captainka67 4 года назад

      yes, this would be handy.

  • @wesleyjiang1979
    @wesleyjiang1979 2 года назад

    how to adjust the space between the body text and the picture?

  • @hemantgull
    @hemantgull 2 года назад

    Good Informative tutorial, Whenever i copy and paste the excel range with hyper links to outlook, they shorten ( Example Original : \\Server\folder1 Changed : folder1, which will not function once clicked )Please help ( Body format Richformat text)

  • @GT_755
    @GT_755 3 года назад +3

    The "oWdEditor" should be "oWordDoc", i think the author is great but he is human. :)

  • @Dookdig1
    @Dookdig1 Год назад

    If i need to add another part , how can i add it

  • @cgfreed3
    @cgfreed3 4 года назад

    Hi this has been incredibly helpful!! I have a question for the single subroutine. Why doesn’t this populate the body of my email? The “here are all the ranges...” shows up but not the range that’s supposed to be copied from excel. I don’t have a problem when the range is specified in the multi subroutine

    • @SigmaCoding
      @SigmaCoding  4 года назад

      Did you make sure to use the "Set" keyword on the line where you specify the Excel Range?

    • @cgfreed3
      @cgfreed3 4 года назад +2

      Sigma Coding thanks a lot! I think the github code is different to the video but it’s all working now. Do you have a video where it shows how a default signature can be added after the range is pasted?

  • @ianlafferty2264
    @ianlafferty2264 Год назад

    For some reason I can seem to get my range area to copy into outlook? Everything else seems to work, the range highlights when the module runs so I assume it’s “copying” just doesn’t seem to paste to outlook 😢 any suggestions?

    • @smartjudy
      @smartjudy Год назад

      Ian I am coming across the same thing. Did you ever figure it out?

    • @ianlafferty2264
      @ianlafferty2264 Год назад

      @@smartjudy no😕 I ended up going down a different route using Power Automate rather than correcting the VBA

  • @dennisprada945
    @dennisprada945 2 года назад

    Very helpful tutorial! How can I do this with multiple range?

  • @ryanyoung8616
    @ryanyoung8616 4 года назад +1

    Hi thankyou this is very helpful! Also, mate can you create a video that adds an existing signature after the copied cell range?

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      Yeah I can look into that.

  • @Gunanimbuzz
    @Gunanimbuzz 3 года назад

    Thank you so much

  • @user-on4je5vg3c
    @user-on4je5vg3c 4 года назад

    Hi! Thanks for the video, it’s been really helpful but I have a question: is this possible to copy excel table with an option of editing it within the outlook?

    • @SigmaCoding
      @SigmaCoding  4 года назад +3

      Like once they paste it in Outlook you can just edit it as a normal table? That is possible you would just change this line:
      oWrdRng.PasteSpecial DataType:=wdPasteMetafilePicture
      To this:
      oWrdRng.PasteSpecial DataType:=wdPasteShape
      or this:
      oWrdRng.Paste

    • @user-on4je5vg3c
      @user-on4je5vg3c 4 года назад

      Sigma Coding yup, thanks a lot for help! Btw, do you have kind of a forum or website where the user can ask the questions? Coz now I’m facing the problem with importing 2 different tables to Outlook and inserting the text between them...may be you or your team could somehow help. Thanks

    • @SigmaCoding
      @SigmaCoding  4 года назад

      @@user-on4je5vg3c One man show here, so I'm the one who has to answer all the questions. It's been getting progressively harder to answer questions as the channel has grown in size, but it's interesting to see how people approach particular tasks. If you want, you can send your code to coding.sigma@gmail.com, and I can take a look at it. It sounds like the selection might be off slightly.
      I've never considered having a forum to ask questions, do you happen to know of a good platform that offers that service?

  • @sumerranawat9335
    @sumerranawat9335 4 года назад

    Wdpastemetafilepicture command is not working

  • @helldream6347
    @helldream6347 2 года назад

    How can you make it work as a button

  • @marcellribeiro8463
    @marcellribeiro8463 3 года назад

    Congrats! Great Video. Is it possible to past as "table" in outlook instead of picture? If yes, could you please say the code?

    • @davidferrick
      @davidferrick 2 года назад +2

      I know this is an old question but change wdPasteMetafilePicture to wdPasteHTML

    • @billcollier6565
      @billcollier6565 9 месяцев назад

      Bless you for asking and answering this question!!! Finally the answer I have been looking for!!

  • @j.dasilva4567
    @j.dasilva4567 2 года назад

    U forgot to mention how to add signature at the end of the email.