OL98: Item Must Be Saved Using ForwardAsVCal, ForwardAsVCard

ID: Q193744

The information in this article applies to:

SYMPTOMS

If you use the ForwardAsVCal or ForwardAsVCard method, you may receive the following error message:

   Could not send the message.

CAUSE

The appointment or contact items must be saved before you use the ForwardAsVCard or ForwardAsVCal methods.

WORKAROUND

To work around this problem, you must programmatically save the item before using the ForwardAsVCard or ForwardAsVCal methods. For a code example, please see the "More Information" section of this article.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Outlook 98.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/default.asp

The ForwardAsVCard method attaches a contact to a new mail message so that it can be sent to someone. The ForwardAsVCal method provides the same functionality, except for appointments.

Steps to Reproduce the Problem

1. Open a new contact form.

2. On the Tools menu, click Forms, and then click Design This Form.

3. Click the P.2 page of the form.

4. On the Form menu, click Control Toolbox.

5. Drag a command button control onto the P.2 page of the form.

6. On the Form menu, click View Code to open the Script Editor. Enter the

   following Visual Basic Scripting Edition (VBScript) code and then close
   the Script Editor.

   Sub CommandButton1_Click()
      Set NewItem = Item.ForwardAsVCard ' error occurs here
      NewItem.Display
   End Sub

7. On the Form menu, click Run This Form.

8. Click the P.2 page of the form and click the command button.

To work around this problem, change the subroutine above to:

   Sub CommandButton1_Click()
      Item.Save
      Set NewItem = Item.ForwardAsVCard ' error occurs here
      NewItem.Display
   End Sub

REFERENCES

For more information about creating solutions with Microsoft Outlook 98, please see the following articles in the Microsoft Knowledge Base:

   Article-ID: Q180826
   Title     : OL98: Resources for Custom Forms and Programming

   Article-ID: Q182349
   Title     : OL98: Questions About Custom Forms and Outlook Solutions

Additional query words: OutSol OutSol98

Keywords          : kbdta OffVBS 
Version           : WINDOWS:
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbpending

Last Reviewed: May 17, 1999