انتقل إلى المحتوى الرئيسي

كيفية إرسال بريد إلكتروني مع نسخ ولصق نطاق محدد في نص البريد الإلكتروني في Excel؟

في كثير من الحالات ، قد يكون النطاق المحدد من المحتويات في ورقة عمل Excel مفيدًا في اتصالات البريد الإلكتروني. في هذه المقالة ، سوف نقدم طريقة لإرسال بريد إلكتروني مع لصق نطاق محدد في نص البريد الإلكتروني مباشرة في Excel.

أرسل بريدًا إلكترونيًا بنطاق محدد تم لصقه في نص البريد الإلكتروني في Excel
أرسل بريدًا إلكترونيًا بنطاق محدد تم لصقه في نص البريد الإلكتروني باستخدام أداة رائعة

المزيد من البرامج التعليمية لإرسالها بالبريد في Excel ...


أرسل بريدًا إلكترونيًا بنطاق محدد تم لصقه في نص البريد الإلكتروني في Excel

يمكن أن تساعدك التعليمات البرمجية لـ VBA التالية على نسخ نطاق ولصقه في نص بريد إلكتروني في Outlook مباشرة في Excel. الرجاء القيام بما يلي.

1. في ورقة العمل تحتوي على النطاق الذي تريد نسخه ، اضغط على قديم + F11 مفاتيح في نفس الوقت لفتح ميكروسوفت فيسوال باسيك للتطبيقات نافذة.

2. في الافتتاح ميكروسوفت فيسوال باسيك للتطبيقات نافذة ، الرجاء الضغط الأدوات > مراجع حسابات كما هو موضح أدناه لقطة الشاشة.

3. في ال المراجع - VBAProject مربع الحوار ، يرجى البحث والتحقق من مكتبة كائنات Microsoft Outlook الخيار ، ثم انقر فوق OK .

4. انقر إدراج > وحدة، ثم انسخ والصق رمز فبا أدناه في نافذة الوحدة النمطية.

كود فبا: أرسل بريدًا إلكترونيًا بنطاق محدد تم لصقه في نص البريد الإلكتروني في Excel

Sub Send_Email()
'Updated by Extendoffice 20200119
    Dim xRg As Range
    Dim I, J As Long
    Dim xAddress As String
    Dim xEmailBody As String
    Dim xMailOut As Outlook.MailItem
    Dim xOutApp As Outlook.Application    
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select range you need to paste into email body", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    For I = 1 To xRg.Rows.Count
        For J = 1 To xRg.Columns.Count
            xEmailBody = xEmailBody & "  " & xRg.Cells(I, J).value
        Next
        xEmailBody = xEmailBody & vbNewLine
    Next
    xEmailBody = "Hi" & vbLf & vbLf & " body of message you want to add" & vbLf & vbLf & xEmailBody & vbNewLine
    With xMailOut
        .Subject = "Test"
        .To = ""
        .Body = xEmailBody
        .Display
        '.Send
    End With
    Set xMailOut = Nothing
    Set xOutApp = Nothing
    Application.ScreenUpdating = True
End Sub

ملاحظة:

  • 1). الرجاء تغيير نص البريد الإلكتروني في السطر xEmailBody = "Hi" & vbLf & vbLf & "نص الرسالة التي تريد إضافتها" & vbLf & vbLf & xEmailBody & vbNewLine ما تحتاج إليه.
  • 2). يرجى تحديد مستلم البريد الإلكتروني والموضوع (إلى = و .Subject = "اختبار") خطوط في الكود.

5. اضغط على F5 مفتاح لتشغيل الكود. في ظهرت كوتولس ل إكسيل في مربع الحوار ، يرجى تحديد النطاق الذي تريد لصقه في نص البريد الإلكتروني ، ثم النقر فوق OK زر. انظر لقطة الشاشة:

6. الآن يتم إنشاء بريد إلكتروني مع المستلم المحدد والموضوع والجسم ونطاق Excel المحدد ، يرجى النقر فوق أرسل زر لإرسال هذا البريد الإلكتروني. انظر لقطة الشاشة المعروضة.

ملاحظات: يعمل رمز VBA فقط عند استخدام Outlook كبرنامج بريد إلكتروني.


أرسل بريدًا إلكترونيًا بنطاق محدد تم لصقه في نص البريد الإلكتروني باستخدام أداة رائعة

إذا كنت لا تستخدم Outlook ولا تزال ترغب في إرسال رسائل بريد إلكتروني مباشرة في Excel مع لصق بيانات نطاق محدد بالداخل ، فإنني أوصي بشدة بـ إرسال رسائل البريد الإلكتروني فائدة كوتولس ل إكسيل لك. باستخدام هذه الميزة ، تحتاج فقط إلى تكوين الخادم الصادر لعنوان بريد إلكتروني ، ثم إرسال رسائل بريد إلكتروني في Excel مباشرةً عبر عنوان البريد الإلكتروني هذا في المستقبل.

قبل التطبيق كوتولس ل إكسيلالرجاء قم بتنزيله وتثبيته أولاً.

1. أولاً ، تحتاج إلى إعداد قائمة بريدية بالحقول المطلوبة.

  • نصائح: يجب أن تحتوي القائمة البريدية على صفين على الأقل ، ويجب أن يكون الصف الأول هو الرؤوس (لنفترض أنك تريد إرسال رسائل بريد إلكتروني إلى عنواني بريد إلكتروني في Excel ، يرجى كتابة عنواني البريد الإلكتروني هذين مع عنوان "البريد الإلكتروني" كما هو موضح في لقطة الشاشة أدناه ).
  • بدلاً من ذلك ، يمكنك بسهولة إنشاء قائمة بريدية باستخدام امتداد إنشاء قائمة بريدية ميزة.

2. حدد النطاق الذي ستضيف البيانات إلى نص البريد الإلكتروني واضغط على CTRL + C مفاتيح لنسخه.

3. حدد القائمة البريدية بالكامل (بما في ذلك الرؤوس) ، انقر كوتولس بلس > إرسال رسائل البريد الإلكتروني. انظر لقطة الشاشة:

4. ثم إرسال رسائل البريد الإلكتروني ينبثق مربع الحوار.

  • 4.1) يتم ملء عناصر القائمة البريدية المحددة في الحقول المقابلة (يمكنك إضافة المزيد من الحقول إلى القائمة البريدية حسب حاجتك) ؛
  • 4.2) انقر فوق مربع نص البريد الإلكتروني ، واضغط على CTRL + V مفاتيح للصق بيانات النطاق المحدد فيه. بعد ذلك ، أضف محتوى آخر حسب حاجتك ؛
  • 4.3 قم بإلغاء تحديد ملف إرسال رسائل البريد الإلكتروني عبر Outlook صندوق؛
  • شنومكس) انقر فوق إعدادات الخادم الصادر زر. انظر لقطة الشاشة:

5. ثم إعدادات خادم البريد الصادر (SMTP) - نظام جديد ينبثق مربع الحوار. يرجى ملء عنوان البريد الإلكتروني بإعدادات الخادم الخاصة به ، وتحديد مجلد لحفظ جميع الرسائل المرسلة بعد التحقق من احفظ رسائل البريد الإلكتروني المرسلة في مربع ، ثم انقر فوق OK زر لحفظ الإعدادات.

6. عندما يعود إلى إرسال رسائل البريد الإلكتروني مربع الحوار، انقر فوق أرسل زر لإرسال البريد الإلكتروني.

من الآن فصاعدًا ، يمكنك إرسال رسائل بريد إلكتروني باستخدام هذه الميزة في Excel مباشرةً.

  إذا كنت ترغب في الحصول على نسخة تجريبية مجانية (30 يومًا) من هذه الأداة المساعدة ، الرجاء الضغط لتنزيلهثم انتقل لتطبيق العملية حسب الخطوات المذكورة أعلاه.


مقالات ذات صلة:

إرسال بريد إلكتروني إلى عناوين البريد الإلكتروني المحددة في الخلايا في Excel
لنفترض أن لديك قائمة بعناوين البريد الإلكتروني ، وتريد إرسال رسالة بريد إلكتروني إلى عناوين البريد الإلكتروني هذه بشكل مجمّع مباشرةً في Excel. كيف تحقق ذلك؟ ستوضح لك هذه المقالة طرق إرسال البريد الإلكتروني إلى عناوين بريد إلكتروني متعددة محددة في خلايا في Excel.

أدخل توقيع Outlook عند إرسال بريد إلكتروني في Excel
لنفترض أنك تريد إرسال بريد إلكتروني مباشرة في برنامج Excel ، فكيف يمكنك إضافة توقيع Outlook الافتراضي في هذا البريد الإلكتروني؟ توفر هذه المقالة طريقتين لمساعدتك في إضافة توقيع Outlook عند إرسال بريد إلكتروني في Excel.

إرسال بريد إلكتروني مع مرفقات متعددة مرفقة في Excel
تتحدث هذه المقالة عن إرسال بريد إلكتروني من خلال Outlook مع مرفقات متعددة مرفقة في Excel.

أرسل بريدًا إلكترونيًا إذا تم الوفاء بتاريخ الاستحقاق في Excel
على سبيل المثال ، إذا كان تاريخ الاستحقاق في العمود C أقل من أو يساوي 7 أيام (التاريخ الحالي هو 2017/9/13) ، فأرسل تذكيرًا بالبريد الإلكتروني إلى المستلم المحدد في العمود A بمحتوى محدد في العمود B. كيف أنجزه؟ ستوفر هذه المقالة طريقة VBA للتعامل معها بالتفصيل.

إرسال البريد الإلكتروني تلقائيًا بناءً على قيمة الخلية في Excel
لنفترض أنك تريد إرسال بريد إلكتروني عبر Outlook إلى مستلم معين بناءً على قيمة خلية محددة في Excel. على سبيل المثال ، عندما تكون قيمة الخلية D7 في ورقة العمل أكبر من 200 ، يتم إنشاء بريد إلكتروني تلقائيًا. تقدم هذه المقالة طريقة VBA لك لحل هذه المشكلة بسرعة.

المزيد من البرامج التعليمية لإرسالها بالبريد في Excel ...

أفضل أدوات إنتاجية المكتب

🤖 مساعد Kutools AI: إحداث ثورة في تحليل البيانات على أساس: التنفيذ الذكي   |  إنشاء التعليمات البرمجية  |  إنشاء صيغ مخصصة  |  تحليل البيانات وإنشاء الرسوم البيانية  |  استدعاء وظائف Kutools...
الميزات الشعبية: البحث عن التكرارات أو تمييزها أو تحديدها   |  حذف الصفوف الفارغة   |  دمج الأعمدة أو الخلايا دون فقدان البيانات   |   جولة بدون صيغة 
سوبر بحث: معايير متعددة VLookup    VLookup ذات القيمة المتعددة  |   VLookup عبر أوراق متعددة   |   بحث غامض ....
قائمة منسدلة متقدمة: إنشاء القائمة المنسدلة بسرعة   |  القائمة المنسدلة التابعة   |  قائمة منسدلة متعددة التحديد ....
مدير العمود: إضافة عدد محدد من الأعمدة  |  نقل الأعمدة  |  تبديل حالة رؤية الأعمدة المخفية  |  مقارنة النطاقات والأعمدة 
الميزات المميزة: التركيز على الشبكة   |  عرض تصميم   |   شريط الفورمولا الكبير    مدير المصنفات والأوراق   |  مكتبة الموارد (النص السيارات)   |  منتقي التاريخ   |  اجمع أوراق العمل   |  تشفير/فك تشفير الخلايا    إرسال رسائل البريد الإلكتروني عن طريق القائمة   |  سوبر تصفية   |   مرشح خاص (تصفية غامق / مائل / يتوسطه خط ...) ...
أفضل 15 مجموعة أدوات12 نص الأدوات (إضافة نص, إزالة الأحرف، ...)   |   +50 رسم الأنواع (مخطط جانت، ...)   |   40+ عملي الصيغ (احسب العمر على أساس تاريخ الميلاد، ...)   |   19 إدخال الأدوات (أدخل رمز الاستجابة السريعة, إدراج صورة من المسار، ...)   |   12 تحويل الأدوات (أرقام إلى كلمات, نتيجة تحويل عملة، ...)   |   7 دمج وتقسيم الأدوات (الجمع بين الصفوف المتقدمة, تقسيم الخلايا، ...)   |   ... و اكثر

عزز مهاراتك في Excel باستخدام Kutools for Excel، واختبر كفاءة لم يسبق لها مثيل. يقدم Kutools for Excel أكثر من 300 ميزة متقدمة لتعزيز الإنتاجية وتوفير الوقت.  انقر هنا للحصول على الميزة التي تحتاجها أكثر...

الوصف


يجلب Office Tab الواجهة المبوبة إلى Office ، ويجعل عملك أسهل بكثير

  • تمكين التحرير والقراءة المبوبة في Word و Excel و PowerPointوالناشر والوصول و Visio والمشروع.
  • فتح وإنشاء مستندات متعددة في علامات تبويب جديدة من نفس النافذة ، بدلاً من النوافذ الجديدة.
  • يزيد من إنتاجيتك بنسبة 50٪ ، ويقلل مئات النقرات بالماوس كل يوم!
Comments (22)
Rated 4.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
The only issue is that the format of the table is not maintained in the mail. Can you let me know how do we preserve the format of the table in the mail, I have the same issue, could you see if you could update it please, otherwise this is excellent.
Many thanks
Rated 4.5 out of 5
This comment was minimized by the moderator on the site
Hi Andy Mitchell,
If you want to maintain the format of the table, the following VBA script can do you a favor. Please give it a try. Thank you.
Sub Send_Email()
'Updated by Extendoffice 20220616
    Dim xRg As Range
    Dim I, J As Long
    Dim xAddress As String
    Dim xMailOut As Object
    Dim xOutApp As Object
    On Error Resume Next
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select range you need to paste into email body", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
    Set xOutApp = CreateObject("Outlook.Application")
    Set xMailOut = xOutApp.CreateItem(olMailItem)
    With xMailOut
        .Subject = "Test"
        .To = ""
        .HTMLBody = RangetoHTML(xRg)
        .Display
        '.Send
    End With
    Set xMailOut = Nothing
    Set xOutApp = Nothing
    Application.ScreenUpdating = True
End Sub

 ' The following VBA script is cited from this page:
 ' https://stackoverflow.com/questions/18663127/paste-excel-range-in-outlook
Function RangetoHTML(rng As Range)
' By Ron de Bruin.
    Dim fso As Object
    Dim ts As Object
    Dim TempFile As String
    Dim TempWB As Workbook

    TempFile = Environ$("temp") & "/" & Format(Now, "dd-mm-yy h-mm-ss") & ".htm"

    'Copy the range and create a new workbook to past the data in
    rng.Copy
    Set TempWB = Workbooks.Add(1)
    With TempWB.Sheets(1)
        .Cells(1).PasteSpecial Paste:=8
        .Cells(1).PasteSpecial xlPasteValues, , False, False
        .Cells(1).PasteSpecial xlPasteFormats, , False, False
        .Cells(1).Select
        Application.CutCopyMode = False
        On Error Resume Next
        .DrawingObjects.Visible = True
        .DrawingObjects.Delete
        On Error GoTo 0
    End With

    'Publish the sheet to a htm file
    With TempWB.PublishObjects.Add( _
         SourceType:=xlSourceRange, _
         Filename:=TempFile, _
         Sheet:=TempWB.Sheets(1).Name, _
         Source:=TempWB.Sheets(1).UsedRange.Address, _
         HtmlType:=xlHtmlStatic)
        .Publish (True)
    End With

    'Read all data from the htm file into RangetoHTML
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
    RangetoHTML = ts.ReadAll
    ts.Close
    RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", _
                          "align=left x:publishsource=")

    'Close TempWB
    TempWB.Close savechanges:=False

    'Delete the htm file we used in this function
    Kill TempFile

    Set ts = Nothing
    Set fso = Nothing
    Set TempWB = Nothing
End Function
This comment was minimized by the moderator on the site
This worked perfectly, thank you so much.
I can now add my spin on it to get it doing what I need.
This comment was minimized by the moderator on the site
Hi Paul Johnson,

Very happy to help you solve the problem. Have a good day at work.
This comment was minimized by the moderator on the site
hello,
can you help me on below
I have create excel sheet & updated 10 supplier mail detailI have send mail through excel to all 10 supplier with individual sheet attachment with individual mail.
I want to paste excel data in outlook body instead of attachment in mail
can any one help me
This comment was minimized by the moderator on the site
Hi,
Instead of selecting the range, I want to select multiple pivots in the excel.
can you please help me.
This comment was minimized by the moderator on the site
Hi,
Instead of selecting the range manually, I want to select the range automatically.
This comment was minimized by the moderator on the site
Hi Raman,
In the below code, please replace the range "A1:C5" in line Set xRg = Range("A1:C5") with your own range.

Sub Send_Email()
Dim xRg As Range
Dim I, J As Long
Dim xAddress As String
Dim xEmailBody As String
Dim xMailOut As Outlook.MailItem
Dim xOutApp As Outlook.Application
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xRg = Range("A1:C5")
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xOutApp = CreateObject("Outlook.Application")
Set xMailOut = xOutApp.CreateItem(olMailItem)
For I = 1 To xRg.Rows.Count
For J = 1 To xRg.Columns.Count
xEmailBody = xEmailBody & " " & xRg.Cells(I, J).Value
Next
xEmailBody = xEmailBody & vbNewLine
Next
xEmailBody = "Hi" & vbLf & vbLf & " body of message you want to add" & vbLf & vbLf & xEmailBody & vbNewLine
With xMailOut
.Subject = "Test"
.To = ""
.Body = xEmailBody
.Display
'.Send
End With
Set xMailOut = Nothing
Set xOutApp = Nothing
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
Hi experts, Do we have updates on how the format maintained?
This comment was minimized by the moderator on the site
Hi Ther,
Can't figure it out. Sorry for that.
This comment was minimized by the moderator on the site
i am seeing a compile error (User-defined type not defined". Please help me out to overcome this.
This comment was minimized by the moderator on the site
Hi,
Please get into the Reference window by clicking Tools > references. Scroll down to find and check the Microsoft Outlook Object Library box and click the OK button to finish the setting.
This comment was minimized by the moderator on the site
this is pasting as a text. Kindly suggest how to send the table or the same format which is copied from the excel.
This comment was minimized by the moderator on the site
Code to send automatically after selecting after ok
This comment was minimized by the moderator on the site
Hi
This code is vary excellent, by using the code i have completed my 90% of my project.
I have same issue as mentioned by Anirudh that is table formatting. How can i format the table in email.
Please help me......
This comment was minimized by the moderator on the site
Good Day,
The problem can't be solved yet. Sorry for the inconvenience and thank you for your comment.
This comment was minimized by the moderator on the site
Hi, Is there any update on below.......
This comment was minimized by the moderator on the site
Hi, Also I Wanted code for "Filter by Date".
I am working on project, on that project I wanted to filter the data by the date, actually we have filter/hide the and last 05 days to current date data and we have highlight all other data.
Please help me to complete this project.
Your help is very great-full for me.
This comment was minimized by the moderator on the site
This is great. It is working as expected. The only issue is that the format of the table is not maintained in the mail. Can you let me know how do we preserve the format of the table in the mail
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations