A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Adressing subfolder - and copy contact ?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 23rd 08, 09:16 AM
myicq myicq is offline
Junior Member
 
First recorded activity at Outlookbanter: Oct 2008
Location: Odense, DK
Posts: 2
Default Adressing subfolder - and copy contact ?

I am using SQLView to categorize and group my contacts. But for the other people in the company I need to populate shared contacts folders.

I can manually copy from SQLView.. but if I forget to hold ctrl, Outlook will move, causing all my categories to be lost.

Now I wish to copy via macro. In that connection, I have two questions:

1) How do I address subfolders with contacts that are NOT below my default contacts ? This will work, but it's not very clear what is happening:

Set colcontacts = objNS.Folders(1).Folders(6).Folders(3).Items

I thought I could do something like

Set colcontacs = objNS.Folders("SQLView\Contacts\Company").Items
but I only get "Object not found"

What is the correct way of addressing subfolders, from the root of MAPI
Namespace ?


2) How do I copy contacts from one folder to another ? I probably need to
delete the destination folder first, not to create duplicates.


.. obviously, if there's a sync tool that will take from folder A to folder B
and check for duplicates, I could use that. But I have only found a tool
that has default contacts as destination.


Thanks for any help
Ads
  #2  
Old October 23rd 08, 10:00 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Adressing subfolder - and copy contact ?


1) Try this:

Set Folder=objNs.Folders("SQLView")
Set Folder=Folder.Folders("Contacts")
Set Folder=Folder.Folders("Company")

2) If you call ContactItem.Copy, a new ContactItem will be returned. Then
cal its Move method and pass the folder object.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: http://www.vboffice.net/product.html?pub=6&lang=en



Am Thu, 23 Oct 2008 09:16:01 +0100 schrieb myicq:

I am using SQLView to categorize and group my contacts. But for the
other people in the company I need to populate shared contacts
folders.

I can manually copy from SQLView.. but if I forget to hold ctrl,
Outlook will move, causing all my categories to be lost.

Now I wish to copy via macro. In that connection, I have two
questions:

1) How do I address subfolders with contacts that are NOT below my
default contacts ? This will work, but it's not very clear what is
happening:

Set colcontacts = objNS.Folders(1).Folders(6).Folders(3).Items

I thought I could do something like

Set colcontacs =
objNS.Folders("SQLView\Contacts\Company").Items
but I only get "Object not found"

What is the correct way of addressing subfolders, from the root of
MAPI
Namespace ?


2) How do I copy contacts from one folder to another ? I probably need
to
delete the destination folder first, not to create duplicates.


. obviously, if there's a sync tool that will take from folder A to
folder B
and check for duplicates, I could use that. But I have only found a
tool
that has default contacts as destination.


Thanks for any help

  #3  
Old October 24th 08, 08:26 AM
myicq myicq is offline
Junior Member
 
First recorded activity at Outlookbanter: Oct 2008
Location: Odense, DK
Posts: 2
Default

Quote:
Originally Posted by Michael Bauer [MVP - Outlook] View Post
1) Try this:

Set Folder=objNs.Folders("SQLView")
Set Folder=Folder.Folders("Contacts")
Set Folder=Folder.Folders("Company")
Thanks..
Although that is exactly the same, only in 3 different lines

Is there a way to use a path-like notification, like \\SQLView\Contacts\Company or similar ? I think I have seen that somewhere in a post on Outlook VBA code.

- Torben.
  #4  
Old October 24th 08, 06:42 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Adressing subfolder - and copy contact ?



It's not the same, by using the names you know what folder you're going to
access. Of course, you can write a function that takes the full path as a
parameter; then the function has to split the path to get all of the folder
names.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Fri, 24 Oct 2008 08:26:03 +0100 schrieb myicq:

'Michael Bauer [MVP - Outlook Wrote:
;271922']1) Try this:

Set Folder=objNs.Folders("SQLView")
Set Folder=Folder.Folders("Contacts")
Set Folder=Folder.Folders("Company")


Thanks..
Although that is exactly the same, only in 3 different lines

Is there a way to use a path-like notification, like
\\SQLView\Contacts\Company or similar ? I think I have seen that
somewhere in a post on Outlook VBA code.

- Torben.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
contact subfolder wren_head[_2_] Outlook - Using Contacts 4 March 24th 08 03:13 PM
How do I view a contact subfolder? wren_head Outlook - Using Contacts 1 March 19th 08 06:24 PM
makro for adressing more folders [email protected]\ Outlook and VBA 2 November 18th 07 06:53 PM
Copy contacts into a subfolder Info Outlook - Using Contacts 2 July 11th 07 10:11 PM
Assign public subfolder to contact [email protected] Outlook - Using Contacts 1 January 25th 06 10:24 PM


All times are GMT +1. The time now is 03:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.