Hi, ich arbeite gerade daran eine Excel Tabelle per mail als VBA zu versende. Ich komme mit meiner Formel nicht weiter, da nur ein teil meiner Excel in Outlook angezeigt wird und bis zu einer bestimmten Spalte abgeschnitten wird. Kann mir da einer weiterhelfen?
Hier ist die Formel
Option Explicit
Sub CopyRangetoOutlook_single()
'Declare Outlook Variables
Dim oLookApp As Outlook.Application
Dim oLookItm As Outlook.MailItem
Dim olooksIns As Outlook.Inspector
'Declare Word Variables
Dim oWrdDoc As Word.Document
Dim oWrdRng As Word.Range
'Declae Excel Variables
Dim ExcRng As Range
On Error Resume Next
'Get the Active instance of Outlook
Set oLookApp = GetObject(, "Outlook.Application")
'If error create a new instance of Outlook
If Err.Number = 429 Then
'Clear Error
Err.Clear
'Create a new instance of Outlook
Set oLookApp = New Outlook.Application
End If
'Create a new email
Set oLookItm = oLookApp.CreateItem(olMailItem)
'Creeate a reference to the Excel Range that we want to export
Set ExcRng = Sheet3.Range("A1:AE74")
With oLookItm
'Define some basic information
.To = "email@web.de;" &
.CC = ""
.Subject = ""
.Body = "Hi"
'Display email
.Display
'Get the Active Inspector
Set olooksIns = .GetInspector
'Get the Word Editor
Set oWrdDoc = olooksIns.WordEditor
'Specify the range in the Document
Set oWrdRng = oWrdDoc.Application.ActiveDocument.Content
oWrdRng.Collapse Direction:=wdCollapseEnd
'Add a new paragraph and then insert a break
oWrdRng.InsertBreak
'Copy the Range
ExcRng.Copy
'Paste it
oWrdRng.PasteSpecial DataType:=wdPasteMetafilePicture
End With
End Sub
|