Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add Attachment in Outlook in reply mode (OS 2k, MS Outlook 98, Acces 2k)

    I have the following code and I want to see if I can make it ask if they want to change the current attachment in message body and add a new one. Here is the current code I have. I say resubmit to the user but it is a reply to the form.

    Elseif Item.Sendername=vrUser then
    If Msgbox("Is this a resubmit job?",vbYesNo, "Initializing") = vbYes then
    CounterStart = 1
    Counter = Rst.RecordCount + CounterStart
    set nms= application.getnamespace("mapi")
    vrUser=nms.currentuser

    UserProperties.Find("jobnum").Value = Counter
    UserProperties.Find("Reqby").Value = vrUser
    UserProperties.Find("txtstatus").Value = "Submit"
    UserProperties.Find("jobtype").Value = "PC Conversion"

    Rst.AddNew
    Rst("Tasknum") = Counter
    Rst("txtstatus") = "Submit"
    Rst("jobtype") = "PC Conversion"
    Rst.fields(4).value=vrUser
    Rst.Update
    Rst.Close
    MyDB.Close
    Else

    Rst.close
    Mydb.close
    Exit Function
    End If
    Else
    RequestNum =UserProperties.Find("jobnum").Value
    Set Rst = MyDB.OpenRecordset("select * from dbtask where tasknum = " & RequestNum)
    UserProperties.Find("txtstatus").Value = rst.Fields(8).Value
    'UserProperties.Find("Coper1").Value = rst.Fields(5).Value

    If UserProperties.Find("txtstatus").Value = "Work in progress" then
    msgbox"This job has been started already"
    End if

    If UserProperties.Find("txtstatus").Value = "Finished" then
    msgbox"This job has been completed already"
    End if

    rst.close
    mydb.close
    End If
    End Function
    '-=-=-=-=-=-=-=-

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Add Attachment in Outlook in reply mode (OS 2k, MS Outlook 98, Acces 2

    First, it's helpful if you preserve the formatting of the code; it's more readable that way:

    Elseif Item.Sendername=vrUser then
    If Msgbox("Is this a resubmit job?",vbYesNo, "Initializing") = vbYes then
    CounterStart = 1
    Counter = Rst.RecordCount + CounterStart
    set nms= application.getnamespace("mapi")
    vrUser=nms.currentuser
    UserProperties.Find("jobnum").Value = Counter
    UserProperties.Find("Reqby").Value = vrUser
    UserProperties.Find("txtstatus").Value = "Submit"
    UserProperties.Find("jobtype").Value = "PC Conversion"
    Rst.AddNew
    Rst("Tasknum") = Counter
    Rst("txtstatus") = "Submit"
    Rst("jobtype") = "PC Conversion"
    Rst.fields(4).value=vrUser
    Rst.Update
    Rst.Close
    MyDB.Close
    Else
    Rst.close
    Mydb.close
    Exit Function
    End If
    Else
    RequestNum =UserProperties.Find("jobnum").Value
    Set Rst = MyDB.OpenRecordset("select * from dbtask where tasknum = " & RequestNum)
    UserProperties.Find("txtstatus").Value = rst.Fields(8).Value
    'UserProperties.Find("Coper1").Value = rst.Fields(5).Value
    If UserProperties.Find("txtstatus").Value = "Work in progress" then
    msgbox"This job has been started already"
    End if
    If UserProperties.Find("txtstatus").Value = "Finished" then
    msgbox"This job has been completed already"
    End if
    rst.close
    mydb.close
    End If

    Second, where is the code relating to the MailItem object? If there is only ever going to be one attachment, you can remove it fairly easily. The trick is how to let them specify a new one. What did you have in mind in terms of interface for that?

Posting Permissions

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