32/64-bit compatible version of Outlook Attachment Manager

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by HansV »

I think I have a solution; I've tested it in Outlook 2007; I want to test it in Outlook 2003 and 2010 tomorrow before posting it here.
Best wishes,
Hans

User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by Goshute »

StuartR wrote:The code does use .HTMLBody rather than .Body if a variable boolHTMLFormat is true. This is set by the line
boolHTMLFormat = (objItem.GetInspector.EditorType = olEditorHTML)
and is always false on my computers, because objItem.GetInspector.EditorType is olEditorWord
Thanks. Apparently I tried to get that part right! :grin: But perhaps I didn't handle olEditorWord correctly. We'll wait for Hans' solution with bated breath.
Goshute
I float in liquid gardens

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by HansV »

I have updated the first post in this thread. The zip file has been replaced with a new version that doesn't remove the formatting from HTML messages in Outlook 2007 and higher. It will still remove formatting from Rich Text messages in ALL versions of Outlook.

If you have already installed the version from January 4, 2011, do the following (it takes considerably longer to write it down than to actually do it):

- Download OLAttachMan7.zip.
- Unzip frmAttachmentManager.frm and frmAttachmentManager.frx to any folder.
- Start Outlook.
- Activate the Visual Basic Editor.
- Expand Forms.
- Select frmAttachmentManager.
- Select File | Remove frmAttachmentManager...
- Click No when prompted to export before removing it.
- Select File | Import File...
- Locate the new, updated version of frmAttachmentManager.frm.
- Click Open.
- Select Debug | Compile Project1 (or whatever name is listed).
- Select File | Save VbaProject.OTM.
- Close the Visual Basic Editor.
Best wishes,
Hans

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by StuartR »

Perfect. Thank you.
StuartR


User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by Goshute »

HansV wrote:... a new version that doesn't remove the formatting from HTML messages in Outlook 2007 and higher. It will still remove formatting from Rich Text messages in ALL versions of Outlook.
Without getting into the weeds too much, what changes did you make?
Goshute
I float in liquid gardens

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by HansV »

I replaced

boolHTMLFormat = (objItem.GetInspector.EditorType = olEditorHTML)

with

boolHTMLFormat = (objItem.BodyFormat = olFormatHTML)

and I now see that I should have done that twice :stupidme:

I'll update the attachment to the first post - again :blush:
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by HansV »

I have updated the first post in this thread with a new version. This time it's not a bug fix, but a tiny addition: a Make New Folder button in the folder browse dialog:
x103.png
If you have already installed the Outlook Attachment Manager, you only need to extract frmAttachmentManager.frm, frmAttachmentManager and basCallbacks, and replace the frmAttachmentManager userform and basCallbacks module in the Visual Basic Editor in Outlook with the new versions.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by StuartR »

Very useful addition, thank you.
StuartR


User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by Goshute »

HansV wrote: a tiny addition: a Make New Folder button in the folder browse dialog
? There was one in my version about 4 years ago (and at present installed on O2003) - what happened to it?
Goshute
I float in liquid gardens

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by HansV »

If I remember correctly, the dialog in the original version didn't open to the currently specified folder. The ideal solution would have been to use Application.FileDialog but for some reason this is not available in Outlook (it is in Word, Excel and PowerPoint). So I switched to a Windows API implementation of the folder browse dialog that allowed me to preset the selected folder. But that doesn't have a "Make New Folder" button by default. This weekend I was Googling around and found it's a simple flag setting.
Best wishes,
Hans

User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by Goshute »

The folder opened for saving files depends on what is specified in the options dialog, but the default that I use is that the file save dialog opens the last folder the tool was used to save files.

So you switched from:

CreateObject("Shell.Application").BrowseForFolder(0, "Select Folder for saving selected files", 0, 0).Items.Item.Path)

Method to the Windows API?
Goshute
I float in liquid gardens

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by HansV »

As far as I know, CreateObject("Shell.Application").BrowseForFolder doesn't let you specify a folder to be selected when the dialog opens. You can only specify a root folder, i.e. a folder higher than which the user cannot go - see Shell.BrowseForFolder Method (Windows).
The code by Randy Birch that I currently use does let you specify the folder to be selected when the dialog opens.
Best wishes,
Hans

User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by Goshute »

HansV wrote:CreateObject("Shell.Application").BrowseForFolder doesn't let you specify a folder to be selected when the dialog opens. You can only specify a root folder, i.e. a folder higher than which the user cannot go. The code by Randy Birch that I currently use does let you specify the folder to be selected when the dialog opens.
You are correct ...BrowseForFolder() defaults to one of several common Windows root folders which has to be set as a parameter. But it does have a default "Make New Folder" button. :yep:
Goshute
I float in liquid gardens

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by HansV »

I rarely want to create a new folder to save e-mails, but I quickly became irritated by having to navigate through many folders EACH time I wanted to use a different folder. So the ability to specify the start folder was more important to me.
The new version combines the best of both worlds. :joy:
Best wishes,
Hans

User avatar
Goshute
3StarLounger
Posts: 397
Joined: 24 Jan 2010, 19:43
Location: Salt Lake City, Utah, USA

Re: 32/64-bit compatible version of Outlook Attachment Manag

Post by Goshute »

HansV wrote:I quickly became irritated by having to navigate through many folders EACH time I wanted to use a different folder. So the ability to specify the start folder was more important to me.
The new version combines the best of both worlds. :joy:
Agree, and thank you for these improvements. :thumbup:
Goshute
I float in liquid gardens