Showing posts with label MS-Outlook. Show all posts
Showing posts with label MS-Outlook. Show all posts

2011-12-14

Outlook Locks Newly Created Folder / Directory

When saving an attachment in Outlook 2007, you can create a new folder in your filesystem first. However, Outlook locks that folder, so you can't move or rename it. You can unlock that folder by ...

  • Saving the attachment in another folder.
  • Creating another folder (though not a sub-folder of the one you just created).
  • Restarting Outlook.

There's an extra method listed in Folder or drive lock after saving attachment or message: use drag-and-drop.

2010-08-01

Restoring Standard Outlook Forms

If you can't see any of the standard Outlook forms, there are two solutions:

  • Clear your Outlook forms cache:
    1. In Outlook, select menu item Tools, Options.
    2. In Options dialog, select Other tab.
    3. In Other tab, press Advanced Options… button.
    4. In Advanced Options dialog, press Custom Forms… button.
    5. In Custom Forms tab, press Manage Forms… button.
    6. In Forms Manager dialog, press Clear Cache button, then press the Close button.
    7. Close all the Option dialogs and try accessing the form again.
  • If the above doesn't work, a more risky solution is to get Outlook to recreate its cache file:
    1. Exit Outlook.
    2. Use Windows Explorer to open the temporary forms folder. On my WinXP PC, the path is C:\Documents and Settings\<user>\Local Settings\Application Data\Microsoft\FORMS.
    3. Rename or delete the file FRMCACHE.DAT.
    4. Start Outlook again.

See Also

2010-07-29

Fixing Broken Image Links in Outlook

If Outlook stops displaying images embedded in HTML e-mail, the fix is to delete files in its temporary file folder. On my WinXP computer, that temporary folder is: C:\Documents and Settings\<user>>\Local Settings\Temporary Internet Files\OLK<random>.

To find the location of Outlook's temporary folder on your PC, open an e-mail message with a Word or Excel attachment, open the attachment and save it. The default location displayed in the application's Save dialog is the location of the temporary folder. This technique works for Word or Excel but other applications may instead show the last folder you used.

For the motivated, the temporary folder's path is stored in the registry in this key: HKCU\Software\Microsoft\Office\<Office version>\Outlook\Security\OutlookSecureTempFolder.

Notes:

  • You can't see that folder using Windows Explorer by browsing the parent folder, C:\Documents and Settings\<user>>\Local Settings\Temporary Internet Files. Instead, to see the contnts of the folder, you have to type in its path in the Explorer's address bar.
  • If you use a CMD console, you can list that folder using the dir command.
  • If you make a shortcut to that folder and try to use the shortcut, Windows shows this warning: This page has an unspecified potential security risk..

See Also

2010-05-13

Prevent VBScript in Custom Outlook Form From Executing

My custom Outlook form added some canned text in the message object in the Item_Open() function. Annoyingly, when I open the form in design mode, the Item_Open() is called, cluttering up the message object. It turns out that you have to hold down the Shift key when opening a form to prevent VBScript in the form from executing.

Holding down the Shift key while starting MS-Access also prevents start-up options from executing, so it is a somewhat consistent feature in MS-Office.

References

2010-05-11

Adding Text To Message Body in Outlook Custom Form

I had a simple request to add some canned text to the message body of a Outlook custom form when the form was first opened, so I did this in VBScript:

Sub Item_Open()
  ...
  Item.HTMLBody = "Blah blah blah"
  ...
End Sub

Yet when I created a new item, the message body was empty! The same problem occurs with Item.Body. After the usual bit of trial-and-error, I discovered that the text only appears if you use HTMLBody or Body on the RHS of a statement:

  Dim strTest
  strTest = Item.HTMLBody
  Item.HTMLBody = "Blah blah blah"
More concisely:
  Item.HTMLBody = "Blah blah blah" & Item.HTMLBody

The text also appears if I display a message box after I add text to the message box.

It seems like the HTMLBody or Body field is not instantiated or refreshed unless it is used.

References

2010-05-01

Outlook To: Field Unexpectedly Shrinks

While developing a custom Outlook form, I found that the To: field would unexpectedly shrink to a few pixels tall and pull the remaining controls in the form upwards. The problem occurred when I added Item.Recipients.Add "test" in my VBScript code to populate the To: field with a dummy e-mail address then clicked in the To: field. (I was using a dummy address to avoid accidentally sending test messages to unsuspecting recipients.) It seems as if putting the cursor into that field while Outlook is resolving the non-existent address (i.e. before it marks that address with a wavy red underline) causes the problem. The problem never happens if you populate the To: field manually with a dummy address, probably because Outlook is resolving the address as you type.

In my case, I found that typing Ctrl+K (Check Names) in the To: field restores the height of the field.

The solution during testing is to use a real address (such as your own).

2010-04-19

Notes on Developing Outlook 2003 Forms

I just finished developing a simple e-mail workflow system implemented using Outlook forms and VBScript and thought I should jot down some things that made development easier:

Configuring Your Development Environment

  • Disable Outlook Autosignature, otherwise your signature is inserted into the message object each time you create a new form and you cannot clear the text in the message object using the Form Designer. While you can clear the message object using VBScript using Item.Body = "", it's annoying to have so much noise during development.
  • If you use VBScript in your form definition, don't send the form definition in each item, otherwise you cannot run VBScript in your item. In the Form Designer's Properties tab, ensure that Send form definition with item is unchecked.
  • Each form definition has a unique Message Class. To ensure that you are opening items based on your form definition in Outlook, add the Message Class field into your Outlook View using the following steps:
    1. Select menu item View, Arrange By, Current View, Customize Current View. Outlook should open the Customize View dialog.
    2. In Customize View: dialog, select Fields... button. Outlook should open the Show Fields dialog.
    3. In Show Fields dialog, select All Mail Fields in the drop down list of available fields.
    4. Select and add Message Class to your view.
  • Create a desktop shortcut to use your form. Using the shortcut is faster than the alternative of using the menu item Tools, Forms, Choose Form and then picking your form from the Choose Form dialog. Plus, when you finish development and publish your form, you can send the shortcut file to your users.

One-Off Forms

If you have VBScript in your form definition, you must avoid making a one-off forms (i.e. an item which no longer references its form definition) because Outlook security does not allow VBScript to run in one-off forms. A one-off form can be identified if its Message Class is not the same as the form definition's and / or its size is much larger than expected. For instance, if you define a form named IPM.Note.Test, instances of this form should have the same message class and a size of about 5 to 6 Kbytes, while a one-off form may be called IPM.Note and / or have a size of in tens of Kbytes. If you think the rules for identify one-off items are a bit vague, read this.

There's a fair bit of documentation and discussion about one-off items online because that's how Outlook forms were first deployed before they were regarded as a security risk. I ignored one-off items (which seemed quite useless nowadays) and treated my form definition as my 'program'. During development, my form definition is published in Personal Folders and I always use that definition to create an item. I also found that using the form designer's Tools, Run This Form menu item creates one-off items.

VBScript Development

When writing VBScript for Outlook forms, you are stuck with the minimal Script Editor which doesn't have features such as highlighting syntax, auto-completion or a debugger; it's so minimal that it doesn't have a Save button or allow you to choose another font! At least changes in the Script Editor are always saved when you publish, so you can leave the Script Editor window open during a coding session.

Script Editor doesn't have a debugger, so you have to use the Outlook Script Debugger, which is the Web Debugger in read-only mode (!) that doesn't allow you to modify Outlook VBScript. The only silver lining that you can inspect objects and find out what properties they have in the script debugger.

Final Thoughts

Developing Outlook Forms with VBSCript was somewhat painful because of the lack of tool support. I hope the tips in this article would be useful for others starting on a similar project.

References