| Code level: intermediate Code area: Basic Outlook Printer Friendly Version | ||
| Title: Contacts as XML | ||
| Description: VBA Script that generates a simple XML document in the same format as an Access XML export. | ||
| Date: 03-Mar-2003 09:02 | ||
| Code level: intermediate | ||
| Code area: Basic Outlook | ||
| Posted by: Randy Haben | ||
| Body: |
||
| All 17comments |
| Page [ 1 2 Next >> ] | ||
|
|
Vera Hawkins
10-Mar-2003 16:21
I have tried the code above but it errors out on the line "Set Folder = Folder.Folders.Item(2)". The error I receive is "Array Index out of bounds." What would be causing thsi? |
|
|
|
Sue Mosher
11-Mar-2003 19:41
In the context of the above code, Folder.Folders.Item(2) would refer to the 2nd subfolder under the default Contacts folder. If you want to work with contacts in your Contacts folder, you don't need that statement. |
|
|
|
Randy Haben
11-Jun-2003 10:36
I apologize. I didn't sanitize the code veru well before posting it. There is another extraneous line. You can delete the assignment to objAppointment -- it was experimental. Also, it's good practice (though not strictly necessary) to Set all object variables to Nothing when you're finished with them. This explicitly releases the associated object interfaces. |
|
|
|
greenconsumerguide
29-Aug-2003 04:28
Once you've exported as XML - how do you get it back into Outlook? |
|
|
|
Sue Mosher
08-Sep-2003 21:38
You'd need to write a reverse routine to map XML elements to Outlook fields. Or see if Access or Excel can handle the XML file, then import from there. |
|
|
|
Sue Mosher
11-Aug-2004 16:49
For another example of exporting contacts to XML, see http://www.topxml.com/snippetcentral/main.asp?view=viewsnippet&lang=xml&id=v20020414223234 (Thanks to Outlook MVP Jessie Louise McClennan for the link) |
|
|
|
Sumit Jaisingh
17-Mar-2005 04:40
can anyone help me in importing custom fields in contacts usign xml |
|
|
|
Sue Mosher
17-Mar-2005 08:27
Sumit, instead of Item.propname for a built-in field, you'd use Item.UserProperties("propname") for a custom field. See http://www.outlookcode.com/d/propsyntax.htm |
|
|
|
Brian Carroll
05-Aug-2005 14:02
If you wanted to do the same thing with Tasks, how would you change the above code? |
|
|
|
Sue Mosher
08-Aug-2005 08:56
YOu would get the Tasks folder instead of the Contacts folder in your GetDefaultFolder expression and set the arguments for the PrintXMLElement statements to use the TaskItem properties that you want to export. |
|
| Page [ 1 2 Next >> ] | ||
| Post your comment name email |
