outmail.display更新屏幕 [英] outmail.display update the screen

查看:91
本文介绍了outmail.display更新屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有下面的代码,它复制了ms字样和过去的Outlook邮件中的内容。发送电子邮件时,userform屏幕会闪烁。我们如何避免屏幕更新。




Dim OutApp1 As Object,OutMail1 As Object, OutWordEditor As Object

    Dim WordDoc As Object

    Dim WordFile As String

     

   设置OutApp1 = CreateObject(" Outlook.Application")

   设置OutMail1 = OutApp1.CreateItem(0)

 设置OutWordEditor = OutMail1.GetInspector.WordEditor

   如果不OutWordEditor是Nothing然后

        

          WordFile = TextBox3.Value

        

      &NBSP ;设置WordDoc = GetObject(WordFile)

        WordDoc.Content.Copy

        WordDoc.Close

        OutWordEditor.Content.Paste

         '出现错误后续续订
            致电ClearClipBoard

       使用OutMail1为
            .To = ws.Cells(i,4).Value

            .CC = ws.Cells(i,9).Value

            .Subject = ws.Cells(i,1).Value& " - " &安培; ws.Cells(I,3)。价值

                              

 

   。显示

           

            。发送


          

       结束


   否则

        

        MsgBox"要使此VBA过程正常工作,您必须将Outlook设置为使用Microsoft Word编辑电子邮件。"
$
        

   结束如果


解决方案


I have below code which copy the content from ms word and past in outlook mail. While send the email, the userform screen get flash. How can we avoid the screen updating.

Dim OutApp1 As Object, OutMail1 As Object, OutWordEditor As Object
    Dim WordDoc As Object
    Dim WordFile As String
     
    Set OutApp1 = CreateObject("Outlook.Application")
    Set OutMail1 = OutApp1.CreateItem(0)
  Set OutWordEditor = OutMail1.GetInspector.WordEditor
    If Not OutWordEditor Is Nothing Then
        
         WordFile = TextBox3.Value
        
        Set WordDoc = GetObject(WordFile)
        WordDoc.Content.Copy
        WordDoc.Close
        OutWordEditor.Content.Paste
         ' On Error Resume Next
             Call ClearClipBoard
        With OutMail1
            .To = ws.Cells(i, 4).Value
            .CC = ws.Cells(i, 9).Value
            .Subject = ws.Cells(i, 1).Value & "-" & ws.Cells(i, 3).Value
                             
 
   .Display
           
            .Send

          
        End With

    Else
        
        MsgBox "For this VBA procedure to work, you must set Outlook to use Microsoft Word to edit email messages."
        
    End If

解决方案


这篇关于outmail.display更新屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆