How To Copy An Excel Range To Outlook Using VBA

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ • 51

  • @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.

  • @VisionNaturelle
    @VisionNaturelle 2 роки тому

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

  • @elzbietadrogomirecka351
    @elzbietadrogomirecka351 3 роки тому +1

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

  • @alvaromartinez758
    @alvaromartinez758 4 роки тому +4

    Can we add the signature after pasting the picture??

  • @jiturane8232
    @jiturane8232 4 роки тому +3

    Can we add signature after paste body mail ??

  • @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?

  • @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. :)

  • @Alucard0831
    @Alucard0831 3 роки тому +1

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

  • @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.

  • @SQ-kk8qt
    @SQ-kk8qt 2 роки тому

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

  • @sorinm221
    @sorinm221 2 роки тому

    This is an awesome tutorial! Life saver.

  • @jacobruiz1671
    @jacobruiz1671 3 роки тому

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

  • @devendranpillaiperumal1178
    @devendranpillaiperumal1178 4 роки тому

    This thing works like magic. Thank you very much

  • @frantzbernier3792
    @frantzbernier3792 2 роки тому

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

  • @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?😊

  • @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?

  • @wesleyjiang1979
    @wesleyjiang1979 2 роки тому

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

  • @michellelee8481
    @michellelee8481 4 роки тому

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

  • @rubyjanebalancio2057
    @rubyjanebalancio2057 5 років тому +1

    This is very helpful! Thank you

  • @ZerheroQal
    @ZerheroQal 4 роки тому

    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.

    • @ZerheroQal
      @ZerheroQal 4 роки тому

      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.

  • @ianlafferty2264
    @ianlafferty2264 2 роки тому

    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

  • @petardzopalic3220
    @petardzopalic3220 Рік тому

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

  • @Dookdig1
    @Dookdig1 Рік тому

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

  • @charliearmour1628
    @charliearmour1628 9 місяців тому

    Excellent, thank you.

  • @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.

  • @cgfreed3
    @cgfreed3 5 років тому

    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  5 років тому

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

    • @cgfreed3
      @cgfreed3 5 років тому +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?

  • @hemantgull
    @hemantgull 3 роки тому

    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)

  • @ryanyoung8616
    @ryanyoung8616 5 років тому +1

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

  • @helldream6347
    @helldream6347 3 роки тому

    How can you make it work as a button

  • @dennisprada945
    @dennisprada945 2 роки тому

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

  • @ВалерияПетрович-у5г

    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  5 років тому +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

    • @ВалерияПетрович-у5г
      @ВалерияПетрович-у5г 5 років тому

      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  5 років тому

      @@ВалерияПетрович-у5г 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

  • @marcellribeiro8463
    @marcellribeiro8463 4 роки тому

    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 Рік тому

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

  • @Gunanimbuzz
    @Gunanimbuzz 3 роки тому

    Thank you so much

  • @GT_755
    @GT_755 3 роки тому +3

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

  • @j.dasilva4567
    @j.dasilva4567 2 роки тому

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