zoukankan      html  css  js  c++  java
  • send email with formatted table

    Option Explicit
    
    Sub SendEmail()
    
    Dim olApp As Object, newEmail As Object
    
    Set olApp = New outlook.Application
    Set newEmail = olApp.CreateItem(olMailItem)
    
    
    With newEmail:
        .To = Sheet1.Range("f18").Text
        .Subject = Sheet1.Range("g18").Text
        
        .Display
            
        Dim xInspect As Object, pageEditor As Object
        
        Set xInspect = newEmail.GetInspector
        Set pageEditor = xInspect.WordEditor
        
        Sheet1.Range("a1:h15").Copy
        
        pageEditor.Application.Selection.Start = Len(.Body)
        pageEditor.Application.Selection.End = pageEditor.Application.Selection.Start
        pageEditor.Application.Selection.Paste
        
        .Send
        
        Set pageEditor = Nothing
        Set xInspect = Nothing
    End With
    
    Set newEmail = Nothing
    Set olApp = Nothing
    
    End Sub
    
  • 相关阅读:
    v-cloak
    MVVM
    初识ajax
    装瓶学习法
    回调函数(call back)
    如何让学习变得纯粹?
    异步
    grep用法
    Shell中的&&与||的区别
    shell中使用>/dev/null 2>&1 丢弃信息
  • 原文地址:https://www.cnblogs.com/otfsenter/p/7449140.html
Copyright © 2011-2022 走看看