Microsoft KB Archive/193744

= OL98: Item Must Be Saved Using ForwardAsVCal, ForwardAsVCard =

Article ID: 193744

Article Last Modified on 5/20/2002

-

APPLIES TO


 * Microsoft Outlook 98 Standard Edition

-



This article was previously published under Q193744



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://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

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
 Open a new contact form. On the Tools menu, click Forms, and then click Design This Form. Click the P.2 page of the form. On the Form menu, click Control Toolbox. Drag a command button control onto the P.2 page of the form.</li>  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 </li> On the Form menu, click Run This Form.</li> Click the P.2 page of the form and click the command button.</li></ol>

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

<div class="references_section">