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

    Check for attached files (MS Outlook 2003)

    I have a form that is used over and over by some people. If they go the their Sent Items folder and call up a form that was sent before it will ask them If this is a Resubmit Job. If they reply YES, I need to figure out a way to look for attched files/pics/etc and delete them. This is what I have so far but I am not sure how to add this new stuff.

    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(2).value=vrUser
    Rst.Update
    Rst.Close
    MyDB.Close
    Else
    Rst.close
    Mydb.Close
    Exit Function
    End if

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Check for attached files (MS Outlook 2003)

    Assuming that Item is a MailItem object, you could use something like this (adapted from the online help for Attachments):

    Dim myAttachments As Attachments
    Set myAttachments = Item.Attachments
    If Not TypeName(myAttachments) = "Nothing" Then
    Do While myAttachments.Count > 0
    myAttachments.Remove 1
    Loop
    End If

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

    Re: Check for attached files (MS Outlook 2003)

    Check for attached files (MS Outlook 2003)
    Post: 440461





    I have a form that is used over and over by some people. If they go the their Sent Items folder and call up a form that was sent before it will ask them If this is a Resubmit Job. If they reply YES, I need to figure out a way to look for attched files/pics/etc and delete them. This is what I have so far but I am not sure how to add this new stuff.

    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

    This is where I tried it... Getting "Name Redefined" error. Not sure how to do. This is a bit beyond me.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Check for attached files (MS Outlook 2003)

    Which line is highlighted when you get the error?

  5. #5
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check for attached files (MS Outlook 2003)

    In the Organization Library, I select the form and the error pops up right away. No line is highligted

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Check for attached files (MS Outlook 2003)

    You'll have to wait for someone familiar with programming Outlook forms then. I never work with forms, sorry.

  7. #7
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check for attached files (MS Outlook 2003)

    Thank anyway. its a start.

  8. #8
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check for attached files (MS Outlook 2003)

    Hans,
    Got it working. I just moved the DIM up to the top and it worked fine.

    Got a new problem though. Now that it deletes any attachment, they want the option to press a button and be able to add a new file attachement. Anybody got any ideas? At the top of the Outlook there are no Attachment buttons at the bar so I guess we have to do it with code.

  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Re: Check for attached files (MS Outlook 2003)

    Daniel, I was following the thread but had nothing to contribute. (I also don't build or code forms.) It's pretty hard to help you when the code snippet you post does not have any Dims, and you tell us the answer was to move the Dim. It would be more helpful to attach all the relevant code as an attachment.

    As to adding the user ability to add files, in standard Outlook VBA, it's probably easiest to code the standard button click with:

    ActiveInspector.CommandBars.FindControl(, 1079).Execute

    ... which pops up the Outlook default File Insert dialog, -but- I don't know if this works in custom forms.
    -John ... I float in liquid gardens
    UTC -7ąDS

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Check for attached files (MS Outlook 2003)

    When I compose or edit an e-mail, there is an "Insert file" button in the Standard toolbar - it looks like a paperclip. I can't remember whether it was there by default, or I had to customize the toolbar, but it is certainly available.

  11. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Re: Check for attached files (MS Outlook 2003)

    It's default.
    -John ... I float in liquid gardens
    UTC -7ąDS

  12. #12
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check for attached files (MS Outlook 2003)

    The Form was created in Edit Compose page for the Users to fill out, at this time the paper clip (Attachment) is visible for them t0 use. When we get a request the form is opened in the Edit Read Page mode. At this time I wanted to attach a new file to the form before it is mailed out to a client. This morning when tried it, I found that the Attachment button is not accessable and does not appear in the Menu Bar at the top of Outlook.

    That is why I need to see if I can add a button so we can attach a file and make it accessable for the client to retrive later.

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Check for attached files (MS Outlook 2003)

    See if John's reply helps. I don't know anything about forms.

Posting Permissions

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