Auto-attachments in Oulook
Results 1 to 12 of 12

Thread: Auto-attachments in Oulook

  1. #1
    Registered User Starbuzz's Avatar
    Join Date
    Feb 2008
    Location
    Northeast US
    Posts
    16

    Auto-attachments in Oulook

    Hello,

    I want to attach an Excel file to all my outgoing Outlook e-mails. This is in a small-business Exchange server environment. Version is Oulook 2003.

    So what I am hoping to do is just allow one user to auto-attach an Excel file whenever he sends an e-mail. So when he clicks on the "New" e-mail and the form opens up, the Excel attachment is already loaded up in the e-mail. All that is left is to type the e-mail and send it.

    Is it possible? I researched well to see if such an option is possible but to no avail.

  2. #2
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    Why an excel file? What information would you put in an excel file that every recipient would want to receive? Would something like vCard be better?
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

  3. #3
    Registered User Starbuzz's Avatar
    Join Date
    Feb 2008
    Location
    Northeast US
    Posts
    16
    The Excel file is actually a complex order entry form that is made up of 2 sheets using the VLOOKUP function.

    The first sheet is the order form itself. The second sheet is locked, hidden, and password protected and this sheet contains the huge company catalogue with products, prices, item numbers, description, packaging info, UPC code, etc. It is a long sheet you can scroll down and down.

    Only 1 person needs to send this Excel file with his e-mails. He does not send that many e-mails out; only to potential customers.

  4. #4
    Registered User Starbuzz's Avatar
    Join Date
    Feb 2008
    Location
    Northeast US
    Posts
    16
    Very sorry for mistake double post. Please delete.

  5. #5
    Registered User CeeBee's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2,494
    Not a solution per se but why not make this thing an online form? Easier to maintain and control the versions of catalog files flowing around. Sooner or later someone *will* use an out of date file for ordering.
    As far as auto-attaching goes, it can be done with a macro.

    Code:
    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
      Dim dRes As Long
      If Item.Attachments.Count = 0 Then
        dRes = MsgBox("You didn't attach the file!" & vbcrlf & "Send anyway?", vbYesNo + vbDefaultButton2 + vbQuestion, "Hey you dummy!")
        If dRes = vbNo Then Cancel = True
      End If
    End Sub
    I'll let you tweak it and put the code to attach the file
    Last edited by CeeBee; April 10th, 2008 at 01:20 PM.
    Protected by Glock. Don't mess with me!

  6. #6
    Registered User Starbuzz's Avatar
    Join Date
    Feb 2008
    Location
    Northeast US
    Posts
    16
    Thank you very much, Cee! I will get started on that. Sorry for my late response as I was away on vacation.

    I have very little experience with macro's but I found this to get me started:
    http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx

    I will work on this right away and see how it goes. Thank you.

    Quote Originally Posted by CeeBee
    Not a solution per se but why not make this thing an online form? Easier to maintain and control the versions of catalog files flowing around. Sooner or later someone *will* use an out of date file for ordering.
    We have a policy of publishing catalogues for each year. Right now the 2008 catalogue is the only one being used. 2007 catalogue is discarded. Customers are sent these catalogues in bulk so they can see the products and such. We also have a web-based order system with the up-to-date online catalogue, which does not replace, but compliments the secondary paper-based (fax) ordering.

    Unfortunately, we have equal number of customers that use both web and fax to order.

    This e-mail/Excel based ordering system seeks to replace the fax-based ordering since they are handwritten on the customer's own forms! Our CS people are losing time typing in the numbers into their application. If it is e-mail based, then they can just copy-paste the order info from the completed Excel file from the customer into their apps to process it thus saving us a lot of time.
    Last edited by Starbuzz; April 16th, 2008 at 10:14 AM.

  7. #7
    Registered User
    Join Date
    Jan 2001
    Location
    Scotland
    Posts
    468
    Is this too simple?

    1 user only sends emails that need this attachment, and they don't send many.

    Why not just let him have a copy of the excel handy (network or desktop) and tell hime to right click>send to email recipient

    Mind you I've been away a while....

  8. #8
    Registered User Starbuzz's Avatar
    Join Date
    Feb 2008
    Location
    Northeast US
    Posts
    16
    Hi all,

    So, the macro did not work. I tried everything. Anyway, the good news is I did find what seems to be the appropriate code for it.

    Here is the code:

    Sub InsertFile()
    ' requires reference to Microsoft Outlook library
    Dim objOL As Outlook.Application
    Dim objInsp As Outlook.Inspector
    Dim objMail As Outlook.MailItem
    On Error Resume Next
    Set objOL = GetObject(, "Outlook.Application")
    Set objInsp = objOL.ActiveInspector
    Set objMail = objInsp.CurrentItem
    objMail.Attachments.Add "C:\data\myfile.txt"
    Set objMail = Nothing
    Set objInsp = Nothing
    Set objOL = Nothing
    End Sub
    I am messing with it now but this is not my area of expertise. I am pretty bad at anything to do with code and programming...even basic things like this. So, I am working on it now. The code seems to make sense as to what I am trying to do.

    Now my main question is that if I specify the path for the file, then that file should load up when I click to open a new mail message right? It doesn't do that...or I am probably doing it wrong.

    I am writing the macro again in Word 2003 as that is set as my default editor for Outlook...let's see how it goes. Other than that, I need your help in trying to create a custom toolbar for it. And also any ideas on how to get this working...thanks everyone.

    Quote Originally Posted by Lowland
    Why not just let him have a copy of the excel handy (network or desktop) and tell hime to right click>send to email recipient
    He does not want to do that. If he did that, I would not be having to do this at all...

  9. #9
    Registered User
    Join Date
    Jan 2001
    Location
    Scotland
    Posts
    468
    Mmm. That would be my point. Sometimes simplest is best is all I was saying.

    Anyay, from my memory only, try googling "yousendit" and attachment alarm. I looked at these a while back, a few years ago.
    Perhaps one can help you.

  10. #10
    Registered User CeeBee's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2,494
    That macro will work in Outlook, but not in Excel or Word.
    Protected by Glock. Don't mess with me!

  11. #11
    Registered User Starbuzz's Avatar
    Join Date
    Feb 2008
    Location
    Northeast US
    Posts
    16
    Hey all!

    I got this problem solved a while ago but I thought I will post the code here so there is a record of the solution here in this forum. The code was given to me by expert Sue Mosher from another forum. She is an author of many IT related books among many other things.

    So here it is:

    Put the code in the ThisOutlookSession module. Then run Application_Startup.

    Dim WithEvents m_colInsp As Outlook.Inspectors
    Dim WithEvents m_objInsp As Outlook.Inspector

    Private Sub Application_Startup()
    Set m_colInsp = Application.Inspectors
    End Sub

    Private Sub m_colInsp_NewInspector(ByVal Inspector As Inspector)
    Set m_objInsp = Inspector
    End Sub

    Private Sub m_objInsp_Activate()
    Dim objMail As Outlook.mailItem
    If m_objInsp.CurrentItem.Class = olMail Then
    Set objMail = m_objInsp.CurrentItem
    If objMail.Size = 0 Then
    ' it's a new message
    objMail.Attachments.Add "C:\Data\myfile.xls"
    End If
    End If
    Set objMail = Nothing
    Set m_objInsp = Nothing
    End Sub
    And if you want to add more files, simply copy the objMail.Attachments.Add "C:\Data\myfile.xls" and paste it underneath in another line. Then of course you have to type in the right directory your files are in.

    Last edited by Starbuzz; May 21st, 2008 at 08:23 AM.

  12. #12
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    Sue's also an Outlook MVP. Glad she could help you.
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

Similar Threads

  1. [RESOLVED] OE attachments problems
    By ADS_Tech in forum Windows XP
    Replies: 2
    Last Post: June 2nd, 2006, 03:12 AM
  2. Auto Assault 14 Day Free Trial
    By TechZ in forum Gaming
    Replies: 0
    Last Post: May 13th, 2006, 02:00 PM
  3. Outlook RTF attachments
    By larsky101 in forum Microsoft Office
    Replies: 3
    Last Post: February 11th, 2005, 03:52 PM
  4. My auto insurance went up 40%! YOU ARE NEXT
    By MacGyver in forum Tech Lounge & Tales
    Replies: 11
    Last Post: May 11th, 2002, 05:15 AM
  5. [RESOLVED] Program cd-roms dont auto start
    By Bill Bennett in forum CD-ROM/CDR(-W)/DVD Drivers
    Replies: 6
    Last Post: February 24th, 2001, 03:08 AM

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
  •