Consulting

Results 1 to 14 of 14

Thread: Outlook Mail comparison from two different forms

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Jul 2021
    Posts
    23
    Location

    Outlook Mail comparison from two different forms

    Hi Team,

    We are having two forms(Form 1 and Sub Forms 1), need to compose mail with comparing different names of table field names.


    ie., Form 1 - Ms no
    Sub Forms 1 - Undergoing MS
    ( But both Ms no and Undergoing MS are same)


    On comparing both we need to get the email id from Sub Forms 1 and send mail in outlook.


    Below is the vba code am using to fetch the mail id from one table. With this i need the above scenario


    Dim olApp As Object
     Dim olMail As Object
     Dim strPath As String
     Dim strLocation As String
     Set olApp = CreateObject("Outlook.Application")
     Set olMail = olApp.CreateItem(0)
     Dim strsubject As String
     Dim sMsgBody As String
     Dim a As String
        M = Me![Email id]
        'b = Me![Status Msg]
    a = Me![MS no]
        'MsgBox a
        T = Me![Title]
        'MsgBox T
        'SB = Me![Subandbranch]
    With olMail
        strsubject = "Received your manuscript for publication, www.ijpbs.net"
        sMsgBody = "Respected author,"
        sMsgBody = sMsgBody & "<br><br>"
        sMsgBody = sMsgBody & "Ref manuscript number  MS: " & a & ""
        sMsgBody = sMsgBody & "<br><br>"
        sMsgBody = sMsgBody & "We have received your research/review article “" & T & "” and the copy right form and would be categorized under " & SB & ". We have allotted manuscript number MS " & a & " for your article. For further correspondence, kindly use this manuscript number only. We would be sending your manuscript to our reviewer (Reviewer 1) for evaluation. We will send the acceptance decision within 7-10 working days"
        sMsgBody = sMsgBody & "<br><br>"
       .To = M
       .Subject = (strsubject)
       .HTMLBody = (sMsgBody)
       '.Attachments.Add "\\Dell-lptp\d\IJPBS process\Vol - 5, Issue 1\Downloads\Down1\link.txt"
       ' strLocation = "\\Dell-lptp\d\IJPBS process\Vol - 5, Issue 1\Downloads\Down1\MS " & a & " RAW.docx"
       '.Attachments.Add (strLocation)
    .Display
    End With
    Set olMail = Nothing
    Set olApp = Nothing

    Kindly help me in this issue.
    Attached Images Attached Images
    Last edited by Aussiebear; 02-18-2022 at 01:30 PM. Reason: Added code tags to supplied code

Tags for this Thread

Posting Permissions

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