outmail.display update the screen RRS feed

  • Question

  • 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)
             ' 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

            End With

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

    • Moved by Neda Zhang Tuesday, November 1, 2016 3:25 AM
    Monday, October 31, 2016 1:51 PM

All replies