• Nifty add-on needed (OL 2002 SP-2)

    Author
    Topic
    #396366

    OK folks, can someone help me out here? I get a lot of file attachments and I’m looking for an add-on that can do some of the work for me. When I click on the attachment in the message header I’d like a ‘save as’ type dialog box to open that I can scroll through to select the save location. When the attachment has been saved, I’d also like it to automatically remove the attachment and append a comment stating the saved file’s name and location. Anyone know if such a thing exists?

    Viewing 3 reply threads
    Author
    Replies
    • #742235

      give EZDetach a try.

    • #742250

      I can provide some crude but free code if you are interested.

      • #742252

        OK, I’ll bite. How crude?

      • #742253

        OK, I’ll bite. How crude?

        • #742262

          (Edited by JohnBF on 11-Nov-03 11:39. Further revisions.)

          Attached. Rather than working on each attachment, it works on all attachments, in any item that can have an attachment. Let me know if you get any errors, as I stripped out some of my old test code (keep it around as a reminder to avoid the mistake next time!) There’s one annoying thing about it, and that is that you have to re-select a folder for every file. I had code where this wasn’t necessary, but that version wasn’t able to then get the selected path. (If I was a professional coder I could probably fix that through a custom form and some API stuff, but I ain’t anywhere that good.) Have fun!

          • #742437

            I just tried the code on a message that had attachments. It stripped the attachments from the message fine, but I couldn’t see that the file path had been appended to the message. The only new text visible in the message was the word “True”. Is the file path stored as some type of message field?

            • #742497

              Rats! Let me review the code to se if I messed it up.

              The file path and file name should be appended to the beginning of the item body. Were the attachments saved to the directory you had selected? Where did the word “True” appear? What format (plain text, RTF or HTML) was the message in?

            • #742503

              The attachments were saved into the directory I selected. The word “True” is at the beginning of the message (see attached screen shot), and the message is in HTML format. (I may be doing something wrong because I am not familiar with using macros.)

            • #742587

              I found a couple of problems, one related to a character conversion when I saved the code in a text file, see if the revised attachment works.

            • #742588

              I found a couple of problems, one related to a character conversion when I saved the code in a text file, see if the revised attachment works.

            • #742504

              The attachments were saved into the directory I selected. The word “True” is at the beginning of the message (see attached screen shot), and the message is in HTML format. (I may be doing something wrong because I am not familiar with using macros.)

            • #742498

              Rats! Let me review the code to se if I messed it up.

              The file path and file name should be appended to the beginning of the item body. Were the attachments saved to the directory you had selected? Where did the word “True” appear? What format (plain text, RTF or HTML) was the message in?

          • #742438

            I just tried the code on a message that had attachments. It stripped the attachments from the message fine, but I couldn’t see that the file path had been appended to the message. The only new text visible in the message was the word “True”. Is the file path stored as some type of message field?

          • #921085

            Hi John,
            I have just been working on something similar in between year-end figures requests and have come up with the attached userform. It obviously still needs a lot of work – there’s no error handling and the functionality is fairly limited at this point – but it works for my current purposes. If you or anyone cares to test it and give me any feedback, I would appreciate it (though I can’t guarantee being able to do anything about it anytime soon!)

            • #921091

              Rory, I couldn’t get the form to import to to my Outlook 2003 VBE Forms folder, it errored out with the following log report:

              Line 8: Property OleObjectBlob in frmFileStripper had an invalid file reference.

              and since it wouldn’t import I can’t debug it.

            • #921111

              Hmm, yes, something seems to have gone horribly wrong with my zip file processing! Try the attached – it’s the frm file but renamed with .txt extension.

            • #921127

              Sorry, Rory, but I’m still getting the same error. Line 8 is

              OleObjectBlob = “frmFileStripper.frx”:0000

              Do you need to also include the file ‘frmFileStripper.frx”, or do I need to install “frmFileStripper.frm” from a certain location or set some VBE reference?

            • #921447

              John,
              Sorry, you’re quite right, I did need to include the frx file. Hopefully now attached!

            • #922087

              (Edited by JohnBF on 14-Jan-05 10:02. Code change correction)

              This is very cool Rory. One criticism and one suggestion:

              1. In the file list-&-select window on the form, Shift-click and Ctrl-click to select multiple files don’t work as they would in standard Windows file multiselect dialogs, anything you can do to fix that?

              2. I haven’t dug into your code yet, but for consistency with URL conventions, I now run all my file locations through a Convert-to UNC function and wrap the non-HTML file names with “” to make them hypertext. Presumably in your

              Private Sub SaveItemsToPath()

              sub, I changed to:

              If (Me.chkHLink) Then
              strSaveName = GetFileUNC(strSaveName)

              using this function:

              Public Function GetFileUNC(ByRef strFilePath As String) As String
              Dim fso As FileSystemObject
              Dim strDriveName As String

              Set fso = CreateObject(“Scripting.FileSystemObject”)
              With fso
              If .FolderExists(strFilePath) Or .FileExists(strFilePath) Then
              strDriveName = Left(.GetAbsolutePathName(strFilePath), 1)
              With .GetDrive(strDriveName)
              If .DriveType = 3 Then
              GetFileUNC = Trim(Replace(strFilePath, strDriveName & “:”, .ShareName, , , vbTextCompare))
              Else
              GetFileUNC = Trim(strFilePath)
              End If
              End With
              End If
              End With
              Set fso = Nothing
              End Function

              and later in your same sub to get RTF and plain text messages to be hypertext:

              Else
              .Body = “File: ” & vbCrLf & .Body

              Nice work! clapping

            • #922092

              John,
              The fix for 1 is easy – the multi-select property of the listbox just needs to be changed to fmMultiSelectExtended. I’d be interested to see your revised UNC version when you’re done!

            • #922096

              1. … changed to frmMultiSelectExtended, thanks.

              2. I edited my proposed code changes (I initially wrapped the GetFile UNC function in the wrong place), see the edits to my post.

              For some reason your brwse for folder window is smaller that the one I’m used to, I may mess with that.

              And I haven’t tested yet, do you have a duplicate file check if a file of the same name already exists?

            • #922097

              John,
              Nope, there’s no check – you get the standard “This file already exists, do you want to replace it?” type message. I admit I’m not overly happy with the BrowseForFolder dialog as it looks a bit old-fashioned so will be working on that too. My current plans for development are:
              1. Turn it into a COM add-in – or it may become my first C# project if I can figure out the Office PIAs (I think there’s a T missing in there!)
              2. Add a batch processing option to detach all files into a selected folder.
              3. Try and work around the security model, though that may be too complicated as I think you need a Shim and trusted code (whatever that may mean).
              4. Add handling for messages which have other messages containing attachments attached.
              5. Add an option to automatically strip attachments from new messages into a specified folder.
              6. Allow for including/excluding embedded images in HTML messages, which I think get treated as attachments.
              There will doubtless be a few other niceties but I think that should keep me going for a while!

            • #922216

              (Attachment updated 07-Mar-07)

              The purpose of this utiliity is to provide attachment users a method of saving attachments, removing them from the message (or other Outlook item), and leaving a hyperlinked record in the message of where the file was saved, clickable to reopen the saved file. If you like it, thank Rory for the foundation and inspiration, and HansV for the polish. thumbup It will be useful for folks who work with large volumes of Outlook attachments, including revisions to the same document, and for those reasons has handling options for recognizing and handling duplicate file names, and for renaming files. The form will work in any folder with items which can contain attachments, or any individual Outlook Item which can hold attachments (AFAIK those items are Message, Calendar, and Task folders and Items).

              Unzip the contents of the file to a temporary location, import the three *.frm forms into the Outlook VBE. Detailed (if terse) installation instructions are now included in the file AttManager Installation Instructions.txt. Code to call the form from a standard Outlook Module is contained in the separate callattachmgr.txt attachment in the ZIP file, and it prevents the form opening if no attachments are found. There’s also an Icon you can use, though it doesn’t have a transparent background yet; copy it from Paint to the Button face after you install the startattachmentmanager macro button.

              Includes Save and Close options, browse for folder, automatic selection of the attachment if there’s only one, automatic closure when the last attachment in the last item selected is saved, a rename-selected-files-before-save function, duplicate handling with a called userform, and Save directly on clicking OK in the Browse for Folder dialog.

              Includes an Option form called from the main form, for Hyperlink insertion, UNC path conversion, default file save location, preferential options on renaming duplicate files, optional retention of the path and folder used the last time the tool was used, and optional ignoring of Outlook Message (*.msg) files; set your options as soon as the forms are installed, otherwise you will inherit mine.

              Bug fixes to date include HTML format message handling, UNC & Hyperlink pasting into the item body text, path name bugs (if the path name contained a date), an overflow problem with long numeric file names (I never realized that my corporate reporting department routinely sends files whose name ends in 32 digits before the file extension), and handling of Read-Only files the user elects to overwrite.

              Please, test this and advise me of logic errors or changes you’d like to see. I tend to build things the way I work, not the way the world works. Suggestions for code improvement are welcome; the logic tested me and there may be redundancies or obvious improvements.

              Thanks again, Rory, can’t wait for the Com Add-In version. evilgrin

            • #922535

              (Edited by rory on 17-Jan-05 17:21. Edited to replace attachment with working copy!)

              John,
              Attached is the first draft COM add-in dll (renamed as .txt so I can upload it). I’ve made a couple of minor alterations/additions, such as a check to see if any items are selected and if any contain attachments. (At this stage it does not deselect any items that do not contain attachments but I guess that should be a simple fix). To test it, save to a location of choice, rename to a DLL, then open a command prompt, browse to the folder the dll is in and type:
              regsvr32 “Attachment stripper.dll”
              I haven’t tested but it’s probably best to have Outlook closed while doing this. The add-in should automatically load when OL is restarted. Let me know if you have any problems!

            • #922556

              I’ll have a look at it. Did you have a look at the stuff I did with your form? You might be interested in a couple of things I did, even though the coding won’t be relevant to C#, especially the display of the current Item Subject, and the additional default location.

              At this point, although I said I was done with it, I’m planning three changes to the form/code:

              1. I plan on incorporating a fourth check box called “Save Outlook messages (“*.msg”) as a separate file?” This would function as follows: if checked, the MSG files are saved to the Browse for Folder location. If unchecked, they are not saved, but they are deleted, and a not hyperlinked file name for the message is inserted into the Body of the message. I had already coded my simple remover/saver to ignore MSG files, because I always open them to see if they already exist, and if they don’t, I run Outlook’s native “Save Copy To Folder”. That way I’m not dumping MSG files to my drives, I’m keeping them in Outlook (as Uncle Bill intended).

              2. Add one extra CR space between the Body and the file list, for clarity.

              3. When the Browse for Folder is clicked OK, the selected files are saved without having to click “Save”. This is a little more consistent with Outlook’s native Save Attachments dialog, and saves a click.

              4. It would probably be wise to have a checkbox for “Substitute UNC (network drives) for drive name where applicable?”

              Feel free to build at least number 1. into your Com add-in. grin

            • #922557

              John,
              FYI, I have just noticed that the code to remove the new toolbar button is not working in my add-in so if you wait a bit I will replace it with an updated version. I actually based this one on the form you provided so it includes your various modifications (though I did readjust the layout a bit!).
              I will have a think about the new additions!

            • #923233

              Hi John,

              I did some limited testing, and the code seems to work well. thumbup

              I noticed one minor point: if you manually enter a path, and forget to include a trailing backslash, the code doesn’t add one. The first attachment I saved therefore was saved as C:FolderFile.doc instead of C:FolderFile.doc; it took me a while to find it… It would be nice if the code added the trailing backslash on the fly if needed.

            • #923466

              Hans, thank you for testing. That specific problem should be fixed, please see the revised attachment.

              To all: a couple of other minor code and cosmetic changes are incorporated. I’m now routinely using this without finding any problems. crossfingers

            • #923355

              John,
              Looks good at first glance yep. I hope to stress test it over the next few days.
              FYI, I have started on the C# version (since I finally got the Office XP PIAs correctly installed) – got as far as setting up the basic connections to Outlook, adding the menu item to launch the forms then got distracted with programming the Office Assistant instead of using messageboxes…

            • #924201

              The new version works well. A non-essential enhancement would be to store preferences (perhaps as an option) for check boxes such as “Replace with hyperlink” and “Default to My Documents” in the registry or in a settings file, and retrieve them in the UserForm_Initialize event.

            • #924315

              Good idea: I could move some of those settings to an Options Form, now you’ve shown me how to have userforms interact bow. Since registry settings are out of my depth, an ‘ini’ file would be good, but AFAIK Outlook doesn’t have default file setting locations the way Word and Excel do. I’m also thinking of changing the handing of attached ‘*.msg files’, I have a little learning curve there.

              But what it does now is very functional for what I need.

            • #924357

              Registry settings are very easy if you’re willing to use a default location assigned by VBA – look up GetSetting and SaveSetting in the VBA help. Examples:

              SaveSetting AppName:="FileStripper", Section:="Options", _
              Key:="DefaultToMyDocuments", Setting:=1

              This will set the value of DefaultToMyDocuments to 1 in the registry key HKEY_CURRENT_USERSoftwareVB and VBA Program SettingsFileStripperOptions. If it doesn’t exist yet, it will be created.

              Dim lngDefaultToMyDocuments As Long
              lngDefaultToMyDocuments = GetSetting(AppName:="FileStripper", _
              Section:="Options", Key:="DefaultToMyDocuments", Default:=1)

              This will retrieve the value of the key mentioned above and assign it to the variable lngDefaultToMyDocuments. If the key doesn’t exist, the default value 1 is used.

            • #924459

              With SaveSetting, the VBA Help states that the Setting argument must be “a combination of keywords, operators, variables, and constants that yields a string, number, or object. An expression can be used to perform a calculation, manipulate characters, or test data.” Hans, does this preclude booleans? Should I just handle them as integers set to zero or -1?

            • #924461

              If you use a boolean variable, the registry key would be set to the string value “True” or “False”. This will be interpreted correctly if you retrieve the value and assign it to a boolean variable – even on non-English language systems. So it’s up to you whether you want to use a boolean, or an integer.

            • #924686

              That raises the general question “when can I trust VBA to do an implict conversion, and when not?”, but that’s probably for the VBA Forum. In an hour or so I’ll post a revision using an Option form and the Registry to store settings the way you explained. Thanks again for your help.

            • #939342

              You state that you are able to save settings in an >Options Form<, is this a form saved on a server? If so could you show me an example so that I could finish a project that I have worked on for quite a while.
              Thank You

            • #939346

              (Edited by JohnBF on 06-Apr-05 08:26. Corrected Post reference.)

              Paul, the Options form is a VBA Userform (called by VBA code in a parent form), and is part of the code attached to the Outlook Application. Forms like this can be created in most Office Apps. The settings are kept in a default locatoin in the local machine Registry file, they are written and read by using the respective VBA SaveSetting and GetSetting Methods, as Hans explained in post 446413 within this thread.

              If you could explain more about what you are trying to do perhaps someone can help.

            • #924726

              cool groovin

            • #924738

              Yeah, I’m happy with it myself. It’s enormously helpful to me, since I deal with lots of attachments at work.

              The last thing I’d like to do is handle Attached Outlook Items better; but Outlook doesn’t know or identify what Application an attachment belongs to, so there’s no easy way to say, “this attachment is an Outlook Item, get the Pickfolder method and select an Outlook Folder for it”. It appears that I might have to save the attachment to a temporary drive folder, shell a second instance of Outlook with the “/f msgfilename” parameter, and try the copy to folder from that instance. Any ideas?

            • #924743

              I don’t know enough about this – perhaps I’m putting my foot in my mouth. Attached Outlook items have Type = olEmbeddeditem, while “ordinary” files have Type = olByValue (=inserted) or olByReference (=linked).

            • #924750

              There’s also a 4th Attachment.Type, olOLE. However, once the item exists*, the Attachment.Type is read-only. *When you are adding the Attachment, manually and at least under CDO, you can set it.

            • #924807

              I know it’s read only, but I thought you might be able to use the Type property to distinguish Outlook attachments from other attachments when looping through the attachments of an item (If .Type = olEmbeddedItem Then … Else … End If). However, I don’t know how dependable that is.

            • #930848

              Sounds as if this thread ended up with some useful code. Is it available for others to use?

              Mike C

            • #930849

              See the attachment to post 443421 higher up in this thread.

            • #930947

              By all means, yes, which is why the Post Hans refers to includes installation instructions. The tool is intended for users who work extensively with attachments, and do not want to keep them attached to the message, but need to know where they were saved. Not all the options may be completely self-evident, but you should be able to figure them out. I have about a dozen people using it in my company. Post back with any problems you have installing or using, and any suggestions for improvement. (There’s just a couple of things left on my to-do list.)

            • #931014

              thank you Hans, thank you John,

              I think I missed that in the tangle of the thread.

              I will try it and let you know amongst other things how an inexperienced onlooker copes with it!

              Mike C

            • #931047

              If you don’t have experience with VBA code in Office Applications, three things that may help are:

              1. set Outlook Macro Security to medium.
              2. some general instructions on using the integrated Visual Basic Editor (VBE) are here
              3. to stop being pestered by the object model guard about running macros, digitally self-sign the macros using SelfCert per the MSDN Digital Signing instructions. (First run a search in File Explorer, including hidden files and folders, to see if SelfCert is already installed. You can create a digital signature starting selfcert.exe direct from the Search window.) Use the suggested defaults to keep it simple. This may sound scary but is really very simple.

            • #934467

              thank you John, I have been out of it for a bit and am still swamped with work. I will follow up when I have a chance.

              Mike C

            • #934941

              John

              Thank you VERY much for writing this utility. It fills a very glaring omission from OL and I really appreciate it. Also liked your link about creating SelfSigned digital certificates. Got rid of the annoying warning whenever outlook was launched. The only suggestion I have after a brief testing is to add a “New Folder” button to the “browse for folder” dialog for specifying the location where to store the files. Otherwise…

              bravo bravo

            • #934944

              In XP OS with Office XP and Office 2003 there is a “Make new Folder” button on the lower left side of the Browse for Folder Dialog. Do you not have it?

            • #935173

              I’ve seen that button on other applications, but it does not appear in your app. I always assumed it was an option that the developer chose to implement or not. Perhaps it is determined by the particular O/S and application software. I am running Outlook 2003 on Windows 2000 Pro. Can’t say for certain if I have ever seen the button in any app on *this* computer.

            • #939189

              Thanks again for the new version. It’s a really powerful yet elegant utility now!

            • #939193

              Yep, I’m getting it mostly where I want it. I was a bit chagrined and amused about what Woody said in OMM 6-05 about 4. REMOVING ATTACHMENTS and in OW 10-08 about 5. SAVE ATTACHMENTS, considering the work that has gone into this utility (not just my efforts) but Woody needs the advertising support.

              I still want to work on the handling of attached Outlook messages, which I did some preliminary stuff on but haven’t made time to work on further, partly because it’s not a priority for me. (This will be my incentive to resume.)

              There’s also one annoyance that I’d be happy to have any expert coder, which could be you Hans, look at. As part of the user interface, especially when large files are being saved, I have inserted:

              Me.MousePointer = fmMousePointerHourGlass

              at appropriate points in the code, including points after child forms or message boxes are closed and the main form is re-displayed. But the hourglass piointer doesn’t seem to display consistently; sometimes on a large file save the hourglass appears only after a long wait just before the main form closes, sometimes it appears right away, and I can’t see a reason for the inconsistent behavior. Any ideas to improve on this problem are welcome.

            • #939549

              John, I’ve only just discovered this thread and what sounds like a great little utility you’ve been working on.

              In fact, I wish I had discovered it earlier because I might have saved the hard-earned dollars I spent on the yousoftware version, which I have to say is so buggy and irritating I had been seriously considering uninstalling it and getting my money back – I think I definitely will now.

              Reading the thread, I have just one comment and one question:

              – the comment – re the problem with existing files with the same name, the yousoftware utility adds an incremental number to the attachment name so an older one is never overwritten. Would this be possible/practical with your utility?

              – the question – the only major thing that the yousoftware utility does that I don’t *think* your utility does is, once you have specified the folder you want the attachments saved to, you never have to say anything to it again if you don’t want to – every time an email comes in with an attachment it is automatically removed, a hyperlink added to the email to its location and (and this is the bit I don’t think you have) the utitlity automatically creates a folder structure within the specified location that is identical to the Outlook folder structure and saves each attachment in the appropriate folder to match the email’s location. I get the impression yours is done manually as each email comes in?

              I must admit I am fully intending to try your utility out as soon as I get home!

              Many thanks!

            • #939554

              Beryl:

              As to duplicate file handling, the file replacement names are suggested rather than automatic, so the user can edit the name for each duplicate found. There is a default option that a user can set that if no date or number is on the end of the file name before the file extension, they can prefer to add either a number, or a date to the file name.

              When a duplicate file is identified, the user has the option to overwrite the file on disk with the attachment, to rename the file, to delete the file from the Outlook item but not save it to disk (already have a more recent version, or an identical one), or skip it and not remove it from the item.

              The file name change suggested when a duplicate is found
              1. If the file exists on drive, and ends with a date (or just a year) the duplicate name form suggests a file name with that date replaced by todays date.
              2. If the file exists on drive, and ends with a number the duplicate name form suggests a file name with that number incremented by 1.
              3. If the file exists on drive, and does not end with either a number or a date, the user Option to add a number or date is applied to the suggested file name.
              But, again, these three options are suggested file names, which the user can edit to something else.

              Sorry, the utility doesn’t automatically save files, it is a called form where the user can handle selected attachments within the message, and process and handle multiple items in a folder window. You can automatically save messages to a set location by code without a user form.

              Try it and see what you think.

            • #939559

              Actually, your naming options sound even better than the ones yousoftware offered!

              bingo Now, if it could just be set to remove/save the attachments automatically …! grin

            • #958322

              John,

              I’m really glad to see this tool available – at work our server-side Outlook file is limited to 45mb – local file size is unlimited, but after several years (and being an inveterate saver) it gets pretty cumbersome trying to find something. So I like to keep currently needed email, attachments, etc. right out there in my Inbox.
              Sadly, though, I’m afraid I don’t understand your directions on how to use the tool. If you can ‘dumb it down’ for the likes of me I’d really appreciate it – I’ve been getting warnings that my mailbox is over its size limit, and I know I have a bunch of Calendar attachments out there bloating my file, but I don’t know how to find and remove them.

              Thanks to Rory, HansV and you –

            • #958381

              Don, I’m not a professional developer, so I don’t have the skills to develop an automatic installation routine – installation is a bunch of manual steps which may be a bit intimidating if you don’t use VBA for MS Office Applications. sorry

              I have added a separate text file with detailed installation instructions in the ZIP file attached to post 443143, in the file AttManager Installation Instructions.txt. (Your request also prompted me to update the zip file with some minor code improvements I have made over the past few months.)

              If you’d like to look at some equivalent professional products, see:
              Microsoft Marketplace – Outlook Add-Ins
              … the MAPILABS product looks very capable, and EZDETACH has already been mentioned, but doesn’t do what I wanted.

              The file doesn’t include use instructions; generally using the Attachment Manager for messages is fairly self evident. But not so self evident for Calendar Items with attachments, so here goes. The tool should be easily available in an individual Appointment window. But if you use a Day/Week/Month View the default planner type of view, it’s tricky to select multiple Appointments. It’s easier to use the Attachment Manager tool on multiple Appointments if you use a table view such as View | Arrange By | Current | Active Appointments, and then click on the attachment icon in the View (see attached graphic) and sort by attachment, select all the Appointments with attachments and then run the tool.

              Post back if you need further help after reading and attempting to follow the instructions.

            • #958384

              Thanks, John – I’ll give it a look-see, and I really appreciate your help with this.

              I probably should have mentioned that I’m using Outlook 2000 SP-3, in case that has an impact on any aspect of the tool.

              Thanks again –

            • #958386

              hmmn It was only really tested on Outlook XP and Outlook 2003, and because MS did expand the extent to which VBA Objects and Methods were exposed from 2000 to XP to 2003, I’m a bit concerned.

              I guess, Don, that you’ll have to be the test pilot for 2000. yep

            • #958390

              (Insert opening credits for 6-Million-Dollar Man here)

              flee

              In the words of some dead guy…”What could possibly go wrong?” wink

            • #958395

              laugh Let the debug messages fall where they may. If you get messages like “this not supported” or “cannot assign to read-only Property”, you are dead in the water.

            • #1163273

              John,

              I installed this code a couple of weeks ago, and I have found it extremely useful. Thank you very much.

              I have a few enhancement requests, feel free to respond with a short sharp negative, but I thought it was worth sharing them anyway.

                [*]When browsing for a folder there is no way to browse to a UNC style name on the network. This makes it difficult to save a document to my offline folders when the drive is not mapped. I have to browse in Windows Explorer and copy/paste the location.
                [*]When I click the browse button it would be much better if the browse window started at the default location, or at the current “Save to location”
                [*]I often have the same attachment on multiple emails (for example if I forward an email to a colleague). I would like to be able to have a response to the message saying this is a duplicate that simply deletes the attachment and adds a link to the existing file. This will avoid my backup software seeing a new file when it is simply the same file re-saved.
            • #1163283

              I have attached the version that I’m using; it uses a different folder browser that starts at the path in the text box. It displays My Network Places, so you can browse to a UNC path too.

              Note: I removed some features because my users didn’t need them.

            • #1163303

              I have attached the version that I’m using; it uses a different folder browser that starts at the path in the text box. It displays My Network Places, so you can browse to a UNC path too.

              Thank you for posting this. Unfortunately it generates a type mismatch error in the Subroutine GetOptions at the line

              Code:
                boolUseLastSessionPath = CBool(GetSetting(AppName:="OLAttManager", _
              	 Section:="Options", Key:="UseLastpath", Default:="False"))
            • #1163318

              I have no idea why that happens. This version has been running without problems on several PCs at work with Outlook 2003 (UK English version) and on my home PC with Outlook 2002 (Dutch version) without problems.

              What happens if you run the macro ResetAttManOptionSettings? Or if you run the macro ViewAttManOptionSettings (output will be in the Immediate window in the Visual Basic Editor)?

            • #1163327

              What happens if you run the macro ResetAttManOptionSettings? Or if you run the macro ViewAttManOptionSettings (output will be in the Immediate window in the Visual Basic Editor)?

              I am running Outlook 2003 SP3, UK English.

              I have deinstalled this version of the tool and reinstalled John’s version, so I can’t test the ResetAttManOptionSettings at the moment. I ran ViewAttManOptionSettings earlier and it gave the same error at the line referencing the same variable.

            • #1163328

              Drat! I remember now – the UseLastPath registry setting is a path string in John’s version and a True/False value in mine. This causes the error. You can correct this by running the ResetAttManOptionSettings macro; this will set UseLastPath to False.

            • #1163331

              Drat! I remember now – the UseLastPath registry setting is a path string in John’s version and a True/False value in mine. This causes the error. You can correct this by running the ResetAttManOptionSettings macro; this will set UseLastPath to False.

              Thanks, I will reinstall your version and try again.

            • #1163384

              You can correct this by running the ResetAttManOptionSettings macro; this will set UseLastPath to False.

              That works perfectly now, thank you.

            • #1163387

              That works perfectly now, thank you.

              BTW, the option “Delete file from the Item, do not save to disk” in the Duplicate File dialog will replace the attachment with a hyperlink to the existing file on disk.

            • #1163424

              BTW, the option “Delete file from the Item, do not save to disk” in the Duplicate File dialog will replace the attachment with a hyperlink to the existing file on disk.

              THANK YOU. I had missed that option. This is absolutely perfect.

            • #1163478

              It displays My Network Places, so you can browse to a UNC path too.

              I’m embarrassed to say I haven’t looked at my own code for about three years.

              Can you tell me where and how you made that change – was it the in last BrowseForFolder parameter in the Private Sub cmdBrowse_Click() in the frmAttachmentManager:

              …(BrowseForFolder(0,”Select folder for saving selected files”,0,0).Items.Item.Path)
              ‘ where 0 = Desktop/all files root, 17 = My Computer, 5 = My Documents, etc.?

            • #1163494

              I replaced that code with a module I got from SHBrowseForFolder: Pre-selecting Folders using a Browse Callback on the VBNet website. It uses Windows API code that I won’t pretend to understand

            • #1174376

              I have been happily using this code for many weeks, and it has led to significant improvements in my productivity.

              My employers have now replaced my trusty (Windows XP / Office 2003) laptop with one that runs Windows Vista and Office 2007. The code still seems to work but I can’t see any way to add a toolbar button to the window used for reading messages. I guess this is the “benefit” of the ribbon. I can still create a toolbar button on the top level Outlook window, but how can I get the Macro to run while I am reading a mail message?

            • #1174378

              I don’t have Office 2007, so this is just guessing. Can you add a button to the Quick Access Toolbar in the message window?

            • #1174381

              I don’t have Office 2007, so this is just guessing. Can you add a button to the Quick Access Toolbar in the message window?

              Probably, but I haven’t even FOUND the Quick Access Toolbar in the message window yet!!!

            • #1174383

              It should be immediately to the right of the Office button.

            • #1174384

              It should be immediately to the right of the Office button.

              Thank you, that helped.
              I can’t edit the button image, just select from the ones provided, but I can at least run the code.

              You can expect to see lots more questions from me as I get used to Vista and Office 2007 over the next few weeks!

            • #1174386

              You can’t edit the button images as you could in earlier versions, except by messing around directly in the XML files – that’s progress for you.

            • #1174472

              Probably, but I haven’t even FOUND the Quick Access Toolbar in the message window yet!!!

              It is right here !

              DaveA I am so far behind, I think I am First
              Genealogy....confusing the dead and annoying the living

            • #1175836

              I have now added toolbar buttons for this and it does work, but sadly it no longer works well.

              When it saves attachments it also reformats ALL text in the message using my default font. This makes it nearly unusable.

              Has anyone else tested this with Office 2007?

            • #1175844

              I have now added toolbar buttons for this and it does work, but sadly it no longer works well.

              When it saves attachments it also reformats ALL text in the message using my default font. This makes it nearly unusable.

              Has anyone else tested this with Office 2007?

              I did and it seemed to work just fine. I don’t recall that anything happened with the message text but I can’t say for sure. I recently installed Windows 7 Ultimate x64 and did not reinstall this. I guess I did not use it enough to remember to re-install it.

              Joe

              --Joe

            • #1175895

              I have now added toolbar buttons for this and it does work, but sadly it no longer works well. When it saves attachments it also reformats ALL text in the message using my default font. Has anyone else tested this with Office 2007?

              Stuart, see if this is a problem specifically with HTML messages (which is pretty much the default format now). If so it may be that the code doesn’t correctly handle the management of HTML when the link is placed in the Body of the message, and that is due to me not really knowing HTML well. Another possibility is that Outlook 2007 changed the VBA Methods used to set and create HTML message body text.

              The code is posted publicy, and I don’t have Outlook 2007 and can’t test it, so other users are welcome to take a poke at it and improve the HTML even in the 2003.

            • #1175914

              Stuart, see if this is a problem specifically with HTML messages …

              I just tested it with a Rich Text message and it does the same.

            • #922099

              This is all I use in my browse for Folder dialog:

              Public Function GetFolderDlg(Optional RootFolder As Variant, _
              Optional Title As String = “Select a Folder”) As String
              On Error Resume Next
              GetFolderDlg = Replace(CreateObject(“Shell.Application”).BrowseForFolder(0, _
              Title, 0, RootFolder).Items.Item.Path & “”, “”, “”)
              End Function

              Would it simplify your code at all?

              And for your amusement, see the attachment, the button which I use for my code, which just became the button calling your form.

            • #921448

              John,
              Sorry, you’re quite right, I did need to include the frx file. Hopefully now attached!

            • #921128

              Sorry, Rory, but I’m still getting the same error. Line 8 is

              OleObjectBlob = “frmFileStripper.frx”:0000

              Do you need to also include the file ‘frmFileStripper.frx”, or do I need to install “frmFileStripper.frm” from a certain location or set some VBE reference?

            • #921112

              Hmm, yes, something seems to have gone horribly wrong with my zip file processing! Try the attached – it’s the frm file but renamed with .txt extension.

            • #921092

              Rory, I couldn’t get the form to import to to my Outlook 2003 VBE Forms folder, it errored out with the following log report:

              Line 8: Property OleObjectBlob in frmFileStripper had an invalid file reference.

              and since it wouldn’t import I can’t debug it.

          • #921086

            Hi John,
            I have just been working on something similar in between year-end figures requests and have come up with the attached userform. It obviously still needs a lot of work – there’s no error handling and the functionality is fairly limited at this point – but it works for my current purposes. If you or anyone cares to test it and give me any feedback, I would appreciate it (though I can’t guarantee being able to do anything about it anytime soon!)

        • #742263

          (Edited by JohnBF on 11-Nov-03 11:39. Further revisions.)

          Attached. Rather than working on each attachment, it works on all attachments, in any item that can have an attachment. Let me know if you get any errors, as I stripped out some of my old test code (keep it around as a reminder to avoid the mistake next time!) There’s one annoying thing about it, and that is that you have to re-select a folder for every file. I had code where this wasn’t necessary, but that version wasn’t able to then get the selected path. (If I was a professional coder I could probably fix that through a custom form and some API stuff, but I ain’t anywhere that good.) Have fun!

    • #742251

      I can provide some crude but free code if you are interested.

    • #1077732

      I have been using the macro version of this for some time, but it’s been broken recently. When I try to reinstall from scratch it tells me it can’t import to the module because the names are already in use (despite my having deleted the earlier module and created a new one.)

      But that probably isn’t the problem – when I try to run the macro, it tells me that macros are disabled, and nothing I do seems to be able to re-enable them…

      Peter English.

      • #1077740

        Did you delete the forms as well? That’s required for a reinstall.

        And you have turned macro security to none to install, closed and restrated Outlook, installed, set macro security to medium, and closed and restarted Outlook again? Can you tell us what the messages are?

        • #1077748

          Thanks, John.

          I hadn’t deleted the forms. Thanks for the pointer.

          I’ve now reinstalled, but still get the message “The macros in this project are disabled. Please refer to the online help or documentation of the host application to determine how to enable macros. [OK] help” when I try to run the macro.

          Macro security is set to “low”.

          Peter.

          • #1077750

            Try my suggestion in the previous post of setting it to “none” and closing and restarting Outlook, then resetting to low – for some reason it’s been known to help

            BTW, which Outlook version do you have the tool installed on?

            • #1077761

              Thanks – I’m using Outlook 2003 SP2. There doesn’t appear to be a “none” option.

            • #1077763

              For whatever reason it is now working again. Perhaps, when I thought I’d closed it down, there was still an outlook window open that I’ missed.

              Many thanks for all the help – it’s SUCH a useful thing!

              Peter.

    Viewing 3 reply threads
    Reply To: Nifty add-on needed (OL 2002 SP-2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: