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?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Nifty add-on needed (OL 2002 SP-2)
Home » Forums » AskWoody support » Productivity software by function » MS Outlook and email programs » Nifty add-on needed (OL 2002 SP-2)
- This topic has 99 replies, 15 voices, and was last updated 15 years, 7 months ago.
AuthorTopicWSasimpkins
AskWoody LoungerNovember 10, 2003 at 10:02 pm #396366Viewing 3 reply threadsAuthorReplies-
WSpostman
AskWoody Lounger -
WSJohnBF
AskWoody Lounger -
WSasimpkins
AskWoody Lounger -
WSasimpkins
AskWoody Lounger -
WSJohnBF
AskWoody LoungerNovember 11, 2003 at 5:39 pm #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!
-
WSWCW
AskWoody LoungerNovember 11, 2003 at 11:55 am #742437I 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?
-
WSJohnBF
AskWoody LoungerNovember 11, 2003 at 1:39 pm #742497Rats! 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?
-
WSWCW
AskWoody LoungerNovember 11, 2003 at 1:54 pm #742503 -
WSJohnBF
AskWoody Lounger -
WSJohnBF
AskWoody Lounger -
WSWCW
AskWoody LoungerNovember 11, 2003 at 1:54 pm #742504 -
WSJohnBF
AskWoody LoungerNovember 11, 2003 at 1:39 pm #742498Rats! 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?
-
-
-
WSWCW
AskWoody LoungerNovember 11, 2003 at 11:55 am #742438I 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?
-
WSrory
AskWoody LoungerJanuary 12, 2005 at 3:13 pm #921085Hi 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!) -
WSJohnBF
AskWoody LoungerJanuary 12, 2005 at 3:25 pm #921091 -
WSrory
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJanuary 12, 2005 at 4:38 pm #921127 -
WSrory
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJanuary 14, 2005 at 4:02 pm #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 StringSet 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 Functionand later in your same sub to get RTF and plain text messages to be hypertext:
Else
.Body = “File: ” & vbCrLf & .BodyNice work!
-
WSrory
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJanuary 14, 2005 at 4:08 pm #9220961. … 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?
-
WSrory
AskWoody LoungerJanuary 14, 2005 at 4:21 pm #922097John,
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! -
WSJohnBF
AskWoody LoungerMarch 7, 2007 at 4:34 pm #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.
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.
-
WSrory
AskWoody LoungerJanuary 17, 2005 at 3:21 pm #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! -
WSJohnBF
AskWoody LoungerJanuary 17, 2005 at 3:13 pm #922556I’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.
-
WSrory
AskWoody LoungerJanuary 17, 2005 at 3:09 pm #922557John,
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! -
WSHansV
AskWoody LoungerJanuary 19, 2005 at 11:27 pm #923233Hi John,
I did some limited testing, and the code seems to work well.
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.
-
WSJohnBF
AskWoody Lounger -
WSrory
AskWoody LoungerJanuary 20, 2005 at 12:08 pm #923355John,
Looks good at first glance. 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… -
WSHansV
AskWoody LoungerJanuary 23, 2005 at 9:43 pm #924201 -
WSJohnBF
AskWoody LoungerJanuary 24, 2005 at 1:21 pm #924315Good idea: I could move some of those settings to an Options Form, now you’ve shown me how to have userforms interact
. 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.
-
WSHansV
AskWoody LoungerJanuary 24, 2005 at 3:59 pm #924357Registry 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:=1This 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.
-
WSJohnBF
AskWoody LoungerJanuary 24, 2005 at 10:12 pm #924459With 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?
-
WSHansV
AskWoody LoungerJanuary 24, 2005 at 10:18 pm #924461If 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.
-
WSJohnBF
AskWoody LoungerJanuary 25, 2005 at 6:55 pm #924686 -
WSbonneyp
AskWoody Lounger -
WSJohnBF
AskWoody LoungerApril 6, 2005 at 2:26 pm #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.
-
WSHansV
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJanuary 25, 2005 at 10:23 pm #924738Yeah, 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?
-
WSHansV
AskWoody Lounger -
WSJohnBF
AskWoody Lounger -
WSHansV
AskWoody LoungerJanuary 26, 2005 at 8:28 am #924807 -
WSMike C
AskWoody Plus -
WSHansV
AskWoody LoungerFebruary 24, 2005 at 7:44 am #930849See the attachment to post 443421 higher up in this thread.
-
WSJohnBF
AskWoody LoungerFebruary 24, 2005 at 1:33 pm #930947By 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.)
-
WSMike C
AskWoody Plus -
WSJohnBF
AskWoody LoungerFebruary 24, 2005 at 7:28 pm #931047If 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. -
WSMike C
AskWoody Plus -
WSjacksonmacd
AskWoody LoungerMarch 15, 2005 at 5:50 pm #934941John
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…
-
WSJohnBF
AskWoody Lounger -
WSjacksonmacd
AskWoody LoungerMarch 16, 2005 at 3:11 pm #935173I’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.
-
WSHansV
AskWoody Lounger -
WSJohnBF
AskWoody LoungerApril 5, 2005 at 10:20 pm #939193Yep, 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.
-
WSBerylM
AskWoody LoungerApril 7, 2005 at 12:53 pm #939549John, 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!
-
WSJohnBF
AskWoody LoungerApril 7, 2005 at 1:29 pm #939554Beryl:
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.
-
WSBerylM
AskWoody Lounger -
WSdjmoore
AskWoody LoungerJuly 7, 2005 at 2:12 pm #958322John,
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 –
-
WSJohnBF
AskWoody LoungerJuly 7, 2005 at 5:33 pm #958381Don, 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.
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.
-
WSdjmoore
AskWoody Lounger -
WSJohnBF
AskWoody Lounger -
WSdjmoore
AskWoody Lounger -
WSJohnBF
AskWoody Lounger -
WSStuartR
AskWoody LoungerJune 3, 2009 at 3:42 am #1163273John,
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. -
WSHansV
AskWoody Lounger -
WSStuartR
AskWoody LoungerJune 3, 2009 at 9:18 am #1163303I 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"))
-
WSHansV
AskWoody LoungerJune 3, 2009 at 9:54 am #1163318I 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)?
-
WSStuartR
AskWoody LoungerJune 3, 2009 at 10:33 am #1163327What 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.
-
WSHansV
AskWoody Lounger -
WSStuartR
AskWoody LoungerJune 3, 2009 at 10:47 am #1163331Drat! 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.
-
WSStuartR
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSStuartR
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJune 4, 2009 at 12:02 pm #1163478It 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.? -
WSHansV
AskWoody LoungerJune 4, 2009 at 1:42 pm #1163494I 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
-
WSStuartR
AskWoody LoungerAugust 21, 2009 at 4:55 am #1174376I 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?
-
WSHansV
AskWoody Lounger -
WSStuartR
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSStuartR
AskWoody LoungerAugust 21, 2009 at 6:05 am #1174384It 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!
-
WSHansV
AskWoody Lounger -
DaveA
AskWoody_MVP -
WSStuartR
AskWoody LoungerSeptember 1, 2009 at 5:45 am #1175836 -
joep517
AskWoody MVPSeptember 1, 2009 at 8:15 am #1175844I 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
-
WSJohnBF
AskWoody LoungerSeptember 1, 2009 at 1:31 pm #1175895I 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.
-
WSStuartR
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJanuary 14, 2005 at 4:29 pm #922099This 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 FunctionWould 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.
-
WSrory
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJanuary 12, 2005 at 4:38 pm #921128 -
WSrory
AskWoody Lounger -
WSJohnBF
AskWoody LoungerJanuary 12, 2005 at 3:25 pm #921092
-
-
-
WSrory
AskWoody LoungerJanuary 12, 2005 at 3:13 pm #921086Hi 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!)
-
WSJohnBF
AskWoody LoungerNovember 11, 2003 at 5:39 pm #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!
WSJohnBF
AskWoody LoungerWSpenglish
AskWoody LoungerOctober 2, 2007 at 12:19 pm #1077732I 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.
-
WSJohnBF
AskWoody LoungerOctober 2, 2007 at 2:26 pm #1077740 -
WSpenglish
AskWoody LoungerOctober 2, 2007 at 3:06 pm #1077748Thanks, 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]
” when I try to run the macro.
Macro security is set to “low”.
Peter.
-
WSJohnBF
AskWoody Lounger -
WSpenglish
AskWoody Lounger -
WSpenglish
AskWoody Lounger
-
-
-
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
April 2025 Office non-Security updates
by
PKCano
4 hours, 48 minutes ago -
Microsoft wants to hear from you
by
Will Fastie
5 hours, 59 minutes ago -
Windows 11 Insider Preview Build 22635.5160 (23H2) released to BETA
by
joep517
8 hours, 20 minutes ago -
Europe Seeks Alternatives to U.S. Cloud Providers
by
Alex5723
13 hours, 51 minutes ago -
Test post
by
Susan Bradley
16 hours, 5 minutes ago -
Used Systems to delete Temp files Gone WRONG what does this mean?
by
Deo
17 hours, 46 minutes ago -
SSD shuts down on its own
by
CWBillow
9 hours, 10 minutes ago -
OneDrive File Sharing Changes
by
David Clark
1 day, 1 hour ago -
OneDrive File Sharing Changes
by
David Clark
1 day, 3 hours ago -
Win 10 Pro 22H2 to Win 11 Pro 23H2 Conversion Guide
by
doneager
3 hours, 56 minutes ago -
Today is world backup day
by
Alex5723
19 hours, 30 minutes ago -
Windows .exe on Mint
by
Slowpoke47
1 day, 5 hours ago -
Reviewing your licensing options
by
Susan Bradley
15 hours, 11 minutes ago -
Apple has been analyzing your photos since September 2024
by
B. Livingston
43 minutes ago -
What Windows 11 24H2 offers beyond bugs
by
Lance Whitney
8 hours, 30 minutes ago -
Making sense of Settings in Windows 11
by
Simon Bisson
15 hours, 44 minutes ago -
Windows 11 pro fails to log in after upgrading Win 10 pro to Win 11 pro 24h2
by
ben_sitaud
1 day, 1 hour ago -
23H2 / 24H2 / Local v. Microsoft Account.
by
CWBillow
23 hours, 29 minutes ago -
YouTube Ad Blocker Blocker
by
bbearren
23 hours, 40 minutes ago -
Obscure historical facts about Windows
by
Cybertooth
1 day, 1 hour ago -
Microsoft Backup
by
Linda2019
17 hours, 2 minutes ago -
What is the best notepad++ version for W7?
by
Picky
1 day ago -
What are right steps to move MS 365 Office+OneDrive files from PC to iMac?
by
glnz
2 days, 10 hours ago -
How to move existing MS 365 Office with OneDrive files from PC to new iMac
by
glnz
2 days, 10 hours ago -
How to move MS 365 files (some on OneDrive) from PC to iMac
by
glnz
3 days, 5 hours ago -
Microsoft adding Quick Machine Recovery to Windows 11
by
Alex5723
3 days, 5 hours ago -
Microsoft vs Passwords
by
Alex5723
12 hours, 56 minutes ago -
Windows 11 Insider Preview build 26200.5516 released to DEV
by
joep517
3 days, 9 hours ago -
Windows 11 Insider Preview build 26120.3653 (24H2) released to BETA
by
joep517
3 days, 9 hours ago -
Two March KB5053606 updates?
by
Adam
3 days, 2 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.