outmail.display更新屏幕 [英] outmail.display update the screen
问题描述
我有下面的代码,它复制了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屋!