+ Reply to Thread
Results 1 to 1 of 1

Autofit in outlook Excel MailEnvelope

Hybrid View

Devendra.dvm Autofit in outlook Excel... 09-23-2019, 05:44 AM
  1. #1
    Registered User
    Join Date
    01-03-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    43

    Autofit in outlook Excel MailEnvelope

    Hi Experts,

    Im trying to send mail using Mail MailEnvelope but the content is getting wrap after sending the mail like below image.
    Capture.JPG


    with my code im able to send mails using MailEnvelope. but excel content and table is getting wropped likw shwon in below picture... please help me to recitfy the same, any help greatly appreciated... thanks in advance.. i have attached my working file for your better understanding.


    Sub Sample_MailEnvelope()
    
    Application.ScreenUpdating = False
    
    Sheets("Mail").Visible = True
    Dim foliorange As Range
    
    Set foliorange = Sheets("Countsheet").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
    
    For Each mycell In foliorange
    
    Worksheets("Mail").Unprotect (".")
    
    Sheets("Mail").Range("A7:B7") = mycell.Offset(0, 2).Value
    Sheets("Mail").Range("C7:D7") = mycell.Offset(0, 3).Value
    Sheets("Mail").Range("E7:F7") = mycell.Offset(0, 4).Value
    
    
      Dim Sendrng As Range
    
        On Error GoTo StopMacro
    
        With Application
            .ScreenUpdating = False
            .EnableEvents = False
        End With
    
    
    Sheets("Mail").Activate
    Range("A1").Select
    
         Set Sendrng = Selection
    
        With Sendrng
    
            ActiveWorkbook.EnvelopeVisible = True
            With .Parent.MailEnvelope
    
     ''.Introduction = "Hi," & vbNewLine & vbNewLine & "Kindly note that we have received the following transactions from you today." & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine
     .Introduction = ""
    
                With .Item
                    .To = mycell.Offset(0, 6).Value    '"sajjanapu.devendra@karvy.com"
                    .CC = mycell.Offset(0, 7).Value
                    .BCC = ""
                    .Subject = "OCBC - IUTA CONFIRMATION"
                    .Display
                    .send
    
                End With
            End With
        End With
    StopMacro:
        With Application
            .ScreenUpdating = True
            .EnableEvents = True
        End With
       ActiveWorkbook.EnvelopeVisible = fasle
    Next mycell
    Worksheets("Mail").Protect "."
    Sheets("Mail").Visible = False
    Application.ScreenUpdating = True
    
    End Sub

    This is cross post : https://stackoverflow.com/questions/...l-mailenvelope
    Last edited by Devendra.dvm; 09-23-2019 at 05:49 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Autofit Table width in Outlook
    By Limor_OP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2019, 05:57 AM
  2. [SOLVED] Can I determine the effect of autofit to .columnwidth prior to executing the autofit?
    By kadeo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-13-2016, 10:29 AM
  3. Help Needed in Inserting Signature in MailEnvelope
    By jmtwentynine in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2015, 12:31 PM
  4. [SOLVED] MailEnvelope unhiding cells on send
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-19-2013, 01:08 PM
  5. How to display email before sending using mailenvelope?
    By hotmailliw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 10:51 AM
  6. Duplicated items when emailing with MailEnvelope
    By beeawwb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2008, 09:19 PM
  7. [SOLVED] MailEnvelope
    By John in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2006, 03:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1