'Sort the rows alphabetically using the CompanyName or FullName as appropriate, and then autofit. TextToDisplay:=Cells(lnContactCount, 6).Value Anchor:=Cells(lnContactCount, 6), _Īddress:="mailto:" & Cells(lnContactCount, 6).Value, _ HomeAddressCityĬells(lnContactCount, 6) =. HomeAddressPostalCodeĬells(lnContactCount, 4) =. HomeAddressStreetĬells(lnContactCount, 3) =. FullNameĬells(lnContactCount, 6).Value =. BusinessAddressCityĬells(lnContactCount, 5).Value =. BusinessAddressPostalCodeĬells(lnContactCount, 4).Value =. BusinessAddressStreetĬells(lnContactCount, 3).Value =. CompanyNameĬells(lnContactCount, 2).Value =. If InStr(olItem.CompanyName, strDummy) > 0 ThenĬells(lnContactCount, 1).Value =. 'For each contact: if it is a business contact, write out the business info in the Excel worksheet 'Row number to place the new information on starts at 2 to avoid overwriting the header Set olFolder = olNamespace.GetDefaultFolder(10) Set olNamespace = olApp.GetNamespace("MAPI") 'Initialize the Outlook variables with the MAPI namespace and the default Outlook folder of the current user. Cells(1, 1).Value = "Company / Private Person" Sample code provided by: Dennis Wallentin, VSTO &. This example imports the contacts from the default Outlook contacts folder to Sheet 1 of the active workbook.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |