Skip to main content

Conas bileog oibre a sheoladh trí Outlook ó Excel amháin?

Más mian leat bileog oibre amháin a sheoladh ar ríomhphost as leabhar oibre in Excel trí Outlook, is féidir leat an bhileog oibre a sheoladh mar cheangaltán, mar ábhar coirp nó mar chomhad PDF. Ach an bhfuil aon bhealaí níos tapa ann chun déileáil leis an bhfadhb seo in Excel?

Seol bileog oibre aonair mar chomhlacht ó Excel le Seol chuig ordú Faighteora Ríomhphoist

Seol bileog oibre aonair mar cheangaltán ó Excel le cód VBA

Seol bileog oibre aonair mar chomhad PDF ó Excel le cód VBA


mboilgeog cheart gorm saighead Seol bileog oibre aonair mar chomhlacht ó Excel le Seol chuig ordú Faighteora Ríomhphoist

Tacaíonn Excel linn an bhileog oibre ghníomhach a sheoladh ar ríomhphost mar ábhar coirp trí úsáid a bhaint as an ordú Seol chuig Faighteoir Ríomhphoist. Is féidir leat a dhéanamh mar a leanas:

Má úsáideann tú Excel 2007, 2010 nó 2013, ní mór duit é seo a chur leis Seol chuig Faighteoir Ríomhphoist ordú don Barra Uirlisí Rochtana Tapa an chéad.

1. Cliceáil ar dheilbhín an Saincheap Barra Uirlisí Rochtana Tapa, agus roghnaigh Tuilleadh Orduithe, féach ar an scáileán:

doc-r-phost-bileog1

2. Agus sa Roghanna Excel bosca dialóige, roghnaigh Orduithe nach bhfuil sa Ribbon sa Roghnaigh Orduithe ó liosta anuas, ansin roghnaigh an Seol chuig Faighteoir Ríomhphoist rogha, agus cliceáil Cuir >> leis cnaipe chun an t-ordú seo a chur leis, cliceáil ar deireadh OK chun an socrú seo a shábháil. Féach an pictiúr:

doc-r-phost-bileog2

3. An Seol chuig Faighteoir Ríomhphoist tá ordú curtha isteach sa Barra Uirlisí Rochtana Tapa, féach ar an scáileán:

doc-r-phost-bileog3

4. Ansin cliceáil seo Seol chuig Faighteoir Ríomhphoist cnaipe deilbhín, agus tagann bosca pras amach, sa Ríomhphost bosca pras, seiceáil Seol an bhileog reatha mar chomhlacht na teachtaireachta, agus cliceáil OK. Féach an pictiúr:

doc-r-phost-bileog4

5. Agus bosca eagarthóireachta ríomhphoist ar taispeáint os cionn sonraí na bileoige oibre, is féidir leat d’fhaighteoirí, ábhar agus réamhrá a iontráil sa bhosca téacs comhfhreagrach. Féach an pictiúr:

doc-r-phost-bileog5

6. Ansin cliceáil Seol an Shee seot an bhileog oibre ghníomhach seo a sheoladh mar chomhlacht teachtaireachta chuig do dhuine ar leith.


mboilgeog cheart gorm saighead Seol bileog oibre aonair mar cheangaltán ó Excel le cód VBA

Más mian leat ríomhphost a sheoladh chuig an mbileog oibre ghníomhach mar cheangaltán, is féidir leis an gcód VBA seo a leanas fabhar a dhéanamh duit.

1. Gníomhachtaigh do bhileog oibre a theastaíonn uait a sheoladh.

2. Coinnigh síos an ALT + F11 eochracha, agus osclaíonn sé an Fuinneog Microsoft Visual Basic for Applications.

3. Cliceáil Ionsáigh > Modúil, agus greamaigh an cód seo a leanas sa Fuinneog an Mhodúil.

Cód VBA: seol an bhileog oibre reatha mar cheangaltán ó Excel

Sub SendWorkSheet()
'Update 20131209
Dim xFile As String
Dim xFormat As Long
Dim Wb As Workbook
Dim Wb2 As Workbook
Dim FilePath As String
Dim FileName As String
Dim OutlookApp As Object
Dim OutlookMail As Object
On Error Resume Next
Application.ScreenUpdating = False
Set Wb = Application.ActiveWorkbook
ActiveSheet.Copy
Set Wb2 = Application.ActiveWorkbook
Select Case Wb.FileFormat
Case xlOpenXMLWorkbook:
    xFile = ".xlsx"
    xFormat = xlOpenXMLWorkbook
Case xlOpenXMLWorkbookMacroEnabled:
    If Wb2.HasVBProject Then
        xFile = ".xlsm"
        xFormat = xlOpenXMLWorkbookMacroEnabled
    Else
        xFile = ".xlsx"
        xFormat = xlOpenXMLWorkbook
    End If
Case Excel8:
    xFile = ".xls"
    xFormat = Excel8
Case xlExcel12:
    xFile = ".xlsb"
    xFormat = xlExcel12
End Select
FilePath = Environ$("temp") & "\"
FileName = Wb.Name & Format(Now, "dd-mmm-yy h-mm-ss")
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
Wb2.SaveAs FilePath & FileName & xFile, FileFormat:=xFormat
With OutlookMail
    .To = ""
    .CC = ""
    .BCC = ""
    .Subject = "kte features"
    .Body = "Please check and read this document."
    .Attachments.Add Wb2.FullName
    .Send
End With
Wb2.Close
Kill FilePath & FileName & xFile
Set OutlookMail = Nothing
Set OutlookApp = Nothing
Application.ScreenUpdating = True
End Sub

nótaí: Sa chód thuas, is féidir leat an fhaisnéis seo a leanas a athrú go do riachtanas féin.

  • .Chuig = ""
  • .CC = ""
  • .BCC = ""
  • .Subject = "gnéithe kte"
  • .Body = "Seiceáil agus léigh an doiciméad seo le do thoil."

4. Ansin cliceáil F5 eochair chun an cód seo a rith, agus tiocfaidh bosca pras amach, cliceáil Ceadaigh nuair a bheidh an barra dul chun cinn críochnaithe, agus ansin an bhileog oibre reatha seolta chuig d’fhaighteoir mar cheangaltán.

doc-r-phost-bileog6


mboilgeog cheart gorm saighead Seol bileog oibre aonair mar chomhad PDF ó Excel le cód VBA

Uaireanta, ní mór duit tuairisc do bhileog oibre a sheoladh chuig daoine eile ach níl tú ag iarraidh ar dhaoine eile í a mhodhnú. Sa chás seo, is féidir leat an bhileog oibre a sheoladh mar chomhad PDF ó Excel.

1. Gníomhachtaigh do bhileog oibre a theastaíonn uait a sheoladh.

2. Coinnigh síos an ALT + F11 eochracha, agus osclaíonn sé an Fuinneog Microsoft Visual Basic for Applications.

3. Cliceáil Ionsáigh > Modúil, agus greamaigh an cód seo a leanas sa Fuinneog an Mhodúil.

Cód VBA: seol an bhileog oibre reatha mar chomhad PDF ó Excel

Sub SendWorkSheetToPDF()
'Update 20131209
Dim Wb As Workbook
Dim FileName As String
Dim OutlookApp As Object
Dim OutlookMail As Object
On Error Resume Next
Set Wb = Application.ActiveWorkbook
FileName = Wb.FullName
xIndex = VBA.InStrRev(FileName, ".")
If xIndex > 1 Then FileName = VBA.Left(FileName, xIndex - 1)
FileName = FileName & "_" + ActiveSheet.Name & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
With OutlookMail
    .To = ""
    .CC = ""
    .BCC = ""
    .Subject = "kte features"
    .Body = "Please check and read this document."
    .Attachments.Add FileName
    .Send
End With
Kill FileName
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub

Nóta: Sa chód thuas, is féidir leat an fhaisnéis seo a leanas a athrú go do riachtanas.

  • .Chuig = ""
  • .CC = ""
  • .BCC = ""
  • .Subject = "gnéithe kte"
  • .Body = "Seiceáil agus léigh an doiciméad seo le do thoil."

4. Ansin brúigh F5 eochair, agus popfaidh bosca pras amach, cliceáil Ceadaigh tar éis críochnú an bharra dul chun cinn, ansin cuireadh an bhileog oibre ghníomhach chuig an duine ar leith mar chomhad PDF.

doc-r-phost-bileog6

Nótaí:

1. Níl na modhanna seo ar fáil ach nuair a úsáideann tú Outlook mar do chlár ríomhphoist.

2. Tar éis duit an bhileog oibre reatha a sheoladh, féadfaidh tú dul chuig do Outlook chun a chinntiú go bhfuil an ríomhphost seolta go rathúil.


Cruthaigh Liosta Ríomhphoist Ansin Seol Ríomhphoist

An Kutools le haghaidh Excel's Cruthaigh Liosta Ríomhphoist agus Seol Emails is féidir le fóntais liosta seoltaí a chruthú go tapa i mbileog oibre, ansin an t-ábhar céanna, an t-ábhar céanna agus na ceangaltáin chéanna a sheoladh chuig seoltaí ríomhphoist iolracha.
liosta seoltaí doc 1
saighead doc síos
liosta seoltaí doc 2

Earraí gaolmhara:

Conas leabhar oibre reatha a sheoladh trí Outlook ó Excel?

Conas raon cealla a sheoladh / ríomhphost trí ionchas ó Excel?

Uirlisí Táirgiúlachta Oifige is Fearr

🤖 Kutools AI Aide: anailís sonraí a réabhlóidiú bunaithe ar: Forghníomhú Chliste   |  Gin Cód  |  Cruthaigh Foirmlí Saincheaptha  |  Anailís a dhéanamh ar Sonraí agus Cairteacha a Ghin  |  Feidhmeanna Kutools a agairt...
Gnéithe Coitianta: Faigh, Aibhsigh nó Aithnigh Dúblaigh   |  Scrios Sraitheanna Bána   |  Comhcheangail Colúin nó Cealla gan Sonraí a Chailleadh   |   Babhta gan Foirmle ...
Cuardaigh Super: Ilchritéir VLookup    VLookup Illuachanna  |   VLookup Trasna Ilbhileoga   |   Amharc doiléir ....
Liosta anuas Casta: Go tapa Cruthaigh Liosta Anuas   |  Liosta anuas Cleithiúnach   |  Liosta Buail Isteach Ilroghnacha ....
Bainisteoir Colún: Cuir Líon Sonrach Colún leis  |  Colúin Bog  |  Scoránaigh Stádas Infheictheachta na gColún Ceilte  |  Déan comparáid idir Raonta & Colúin ...
Gnéithe Réadmhaoin: Fócas Eangaí   |  Amharc Dearaidh   |   Barra Mór na Foirmle    Leabhar Oibre & Bainisteoir Bileog   |  Leabharlann Acmhainní (Uaththéacs)   |  Piocálaí Dáta   |  Comhcheangail Bileoga Oibre   |  Criptigh/Díchriptigh Cealla    Seol Ríomhphost trí Liosta   |  Scagaire Super   |   Scagaire Speisialta (scagaire trom/iodálach/stailc tríd...) ...
Barr 15 Uirlisí12 Téacs uirlisí (Cuir Téacs, Bain Carachtair,...)   |   50 + Cairt cineálacha (Cairt Gantt,...)   |   40+ Praiticiúil Foirmlí (Ríomh aois bunaithe ar lá breithe,...)   |   19 Insertion uirlisí (Cuir isteach Cód QR, Ionsáigh Pictiúr ón gCosán,...)   |   12 Tiontú uirlisí (Uimhreacha le Focail, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Supercharge Do Scileanna Excel le Kutools le haghaidh Excel, agus Éifeachtúlacht Taithí Cosúil Ná Roimhe. Kutools le haghaidh Excel Tairiscintí Níos mó ná 300 Ardghnéithe chun Táirgiúlacht a Treisiú agus Sábháil Am.  Cliceáil anseo chun an ghné is mó a theastaíonn uait a fháil ...

Tuairisc


Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!
Comments (34)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I've found the code you post for Typhaine and it works very well for me.
So thank's very much.
Philip.
This comment was minimized by the moderator on the site
Bonjour,

Est-il possible d'utiliser le code pour joindre deux feuilles du fichier Excel dans le mail ?

Merci d'avance.
This comment was minimized by the moderator on the site
Hello, Typhaine
To send multiple sheets, please apply the below code:
Note: In the code, you should change the sheet names to your own.
Sub Mail_Sheets_Array()
    Dim FileExtStr As String
    Dim FileFormatNum As Long
    Dim Sourcewb As Workbook
    Dim Destwb As Workbook
    Dim TempFilePath As String
    Dim TempFileName As String
    Dim OutApp As Object
    Dim OutMail As Object
    Dim sh As Worksheet
    Dim TheActiveWindow As Window
    Dim TempWindow As Window
    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With
    Set Sourcewb = ActiveWorkbook
    With Sourcewb
        Set TheActiveWindow = ActiveWindow
        Set TempWindow = .NewWindow
        .Sheets(Array("Sheet1", "Sheet2")).Copy
    End With
    TempWindow.Close
    Set Destwb = ActiveWorkbook
    With Destwb
        If Val(Application.Version) < 12 Then
           
            FileExtStr = ".xls": FileFormatNum = -4143
        Else
            
            Select Case Sourcewb.FileFormat
            Case 51: FileExtStr = ".xlsx": FileFormatNum = 51
            Case 52:
                If .HasVBProject Then
                    FileExtStr = ".xlsm": FileFormatNum = 52
                Else
                    FileExtStr = ".xlsx": FileFormatNum = 51
                End If
            Case 56: FileExtStr = ".xls": FileFormatNum = 56
            Case Else: FileExtStr = ".xlsb": FileFormatNum = 50
            End Select
        End If
    End With
    TempFilePath = Environ$("temp") & "\"
    TempFileName = "Part of " & Sourcewb.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss")

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    With Destwb
        .SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
        On Error Resume Next
        With OutMail
            .To = ""
            .CC = ""
            .BCC = ""
            .Subject = "KTE features"
            .Body = "Please check and read this document"
            .Attachments.Add Destwb.FullName
           
            .Display
        End With
        On Error GoTo 0
        .Close savechanges:=False
    End With
   
    Kill TempFilePath & TempFileName & FileExtStr

    Set OutMail = Nothing
    Set OutApp = Nothing

    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With
End Sub


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Hej,

Muszę wysłać zakres (stały) arkusza jako obraz w treści maila jednocześnie dodając cały arkusz jako plik/załącznik. Czy jest to możliwe?
This comment was minimized by the moderator on the site
Hi the program worked just fine till 2021, I tried to run it  today, but it does send the email. As does notshow any errors
This comment was minimized by the moderator on the site
This is to inform you that i have an VBA code for send email from outlook with the help of excel vba,now i want to put "MDD Code" & " MDD Name" as well as Cells(i, 1) & Cells(i, 2) in a table like that.

MDD Code MDD Name
M123 Joydip

I am sending you the VBA Code,Request you for help.
VBA Code
----------------------------------------------------------------------------------------------------------------------------------------------
Sub sendmail()

Dim olapp As Outlook.Application

Dim olmail As Outlook.MailItem

For i = 2 To 35

Application.ScreenUpdating = False

Set olapp = New Outlook.Application

Set olmail = olapp.CreateItem(olMailItem)

With olmail

olmail.To = Cells(i, 4).Value

olmail.CC = Cells(i, 6).Value

olmail.Subject = Cells(i, 7).Value

olmail.HTMLBody = "Dear Partner ," & _

"
Please find the attchment." & _

"

MDD Code : " & Cells(i, 1) & _

"
MDD Name : " & Cells(i, 2) & _

"






Joydip Bhattacharjee" & _

"
Company" & _

"
MIS" & _

"
Country" & _

"
Contact No : 7602066491"







olmail.Attachments.Add Cells(i, 8).Value

'On Error Resume Next

'olmail.Attachments.Add Cells(i, 9).Value

'On Error Resume Next

'olmail.Attachments.Add Cells(i, 10).Value

'On Error Resume Next

'olmail.Attachments.Add Cells(i, 11).Value

'On Error Resume Next

'olmail.Attachments.Add Cells(i, 12).Value

'On Error Resume Next

'olmail.Attachments.Add Cells(i, 13).Value

'On Error Resume Next

'olmail.Attachments.Add Cells(i, 14).Value

'On Error Resume Next

olmail.Send

End With

Set olmail = Nothing

Next

End Sub
This comment was minimized by the moderator on the site
merhaba ben bunu belirli periyotta otomatik mail atmasını nasıl ayarlayabilirim
This comment was minimized by the moderator on the site
Excelent code. Thanks!
This comment was minimized by the moderator on the site
Anyway I can easily send an excel worksheet through my outlook without all this ?? I can send the worksheet context, but no the workbook as an attachment. On my work computer I can send from word and excel, but am having trouble at home.
This comment was minimized by the moderator on the site
Hi! Is it possible to use this code, but instead of sending straight away it opens up the mail?
This comment was minimized by the moderator on the site
You can try this code:
Sub SendWorkSheet()
'Update 20180109
Dim xFile As String
Dim xFormat As Long
Dim Wb As Workbook
Dim Wb2 As Workbook
Dim FilePath As String
Dim FileName As String
Dim OutlookApp As Object
Dim OutlookMail As Object
On Error Resume Next
Application.ScreenUpdating = False
Set Wb = Application.ActiveWorkbook
ActiveSheet.Copy
Set Wb2 = Application.ActiveWorkbook
Select Case Wb.FileFormat
Case xlOpenXMLWorkbook:
xFile = ".xlsx"
xFormat = xlOpenXMLWorkbook
Case xlOpenXMLWorkbookMacroEnabled:
If Wb2.HasVBProject Then
xFile = ".xlsm"
xFormat = xlOpenXMLWorkbookMacroEnabled
Else
xFile = ".xlsx"
xFormat = xlOpenXMLWorkbook
End If
Case Excel8:
xFile = ".xls"
xFormat = Excel8
Case xlExcel12:
xFile = ".xlsb"
xFormat = xlExcel12
End Select
FilePath = Environ$("temp") & "\"
FileName = Wb.Name & Format(Now, "dd-mmm-yy h-mm-ss")
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
Wb2.SaveAs FilePath & FileName & xFile, FileFormat:=xFormat
With OutlookMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "kte features"
.Body = "Please check and read this document."
.Attachments.Add Wb2.FullName
.Display
' .Send
End With
Wb2.Close
Kill FilePath & FileName & xFile
Set OutlookMail = Nothing
Set OutlookApp = Nothing
Application.ScreenUpdating = True
End Sub

Please let me know if it works for you, thank you.
This comment was minimized by the moderator on the site
This code works good, however, does anyone know a way to automate a field as an alert for the email to go automatically based on a date column?
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