Microsoft KB Archive/885941

= How to iterate through account addresses for any entity that implements the ICustomerVendorAccount interface in Accounting Professional 2007, Accounting Express 2007, or in Small Business Accounting 2006 =

Article ID: 885941

Article Last Modified on 2/8/2007

-

APPLIES TO


 * Microsoft Office Accounting Professional 2007
 * Microsoft Office Accounting Express 2007
 * Microsoft Office Small Business Accounting 2006
 * Microsoft Office Small Business Management Edition 2006
 * Microsoft Office Small Business Accounting 2006 Software Development Kit 1.2

-





INTRODUCTION
This article describes how to iterate through account addresses for any entity that implements the ICustomerVendorAccount interface in the following programs:
 * Microsoft Office Accounting Professional 2007
 * Microsoft Office Accounting Express 2007
 * Microsoft Office Small Business Accounting 2006



MORE INFORMATION
You can access the account addresses by using the CustomerVendorAddresses property. The following code sample will display each address for a particular customer when you run the code in a command-line program. Console.WriteLine(&quot;enter a customer account integer:&quot;); int custInt = Convert.ToInt32(Console.ReadLine); ICustomerAccount iCa = (ICustomerAccount)iSbi.CustomerAccounts.GetByPrimaryKey(custInt);

Console.WriteLine(&quot;\ncustomer information:\n{0}\n{1}\n\naddress information:&quot;, iCa.AccountID, iCa.Name);

foreach (int i in Enum.GetValues(typeof(CustomerVendorAddressType))) {   if (iCa.CustomerVendorAddresses.DoesTypeExist(i)) {       ICustomerVendorAddress iCva = iCa.CustomerVendorAddresses.GetByType((CustomerVendorAddressType) i); Console.WriteLine(&quot;\n{0}\n{1}, {2} {3}&quot;,            iCva.Address1, iCva.City, iCva.State, iCva.ZipCode); } } Note iSbi is a reference variable of ISmallBusinessInstance.

Additional query words: Content Maintenance 40732, SBA, SDK

Keywords: kbhowto kbmbsmigrate KB885941

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.