[AccessD] Export Contacts to Outlook

Jack and Pat drawbridgej at sympatico.ca
Sun Nov 7 20:16:35 CST 2010


More testing and I got an answer at VBAX

Sample code  ----watch line wrap

Sub crow()
Dim olnamespace As NameSpace
Dim olfolder As MAPIFolder
Set olfolder = Application.GetNamespace("MAPI").Folders("Personal Home
Folders").Folders("Keepers")
olfolder.Display
End Sub


jack
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Sunday, November 07, 2010 6:03 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Export Contacts to Outlook

Jack:

Stand by.  I just got an email from Helen Feddema.  She says she knows the
syntax I need and included another method to do the same thing. Haven't had
a chance to look at it though.  Will report back presently.

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jack and Pat
Sent: Sunday, November 07, 2010 9:47 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Export Contacts to Outlook

Rocky,

I'm not an Outlook person really. I have done some vba for Outlook and have
never really understood the object model.
In the code I referenced in my earlier email, I found I had to give the
folder path starting with "// my top level/.../level I wanted to be at"
Using the GetFolder function, it opened a new window at the folder I wanted.
It worked for 2 different folders in 2 different pst files.

I still don't understand why there isn't a syntax along the line of

Application.Outlook.Folders.Folder("FolderYouWant)"

I've tried posting on OutlookCode.com  and vbaexpress.com but haven't gotten
much back.

The OutlookCode.com is run by Sue Mosher who has written many books/articles
on Outlook.

I hope you find a solution that we can share.
jack

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Sunday, November 07, 2010 10:30 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Export Contacts to Outlook

Well, I'm trying that code that Jack posted - a function that searches for
the folder passed to it. So it shouldn't matter if they move the folder -
the function should find it.  I think...

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Sunday, November 07, 2010 7:04 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Export Contacts to Outlook

Using an index isn't the same as hard-coding though Rocky. I'm wondering --
with an index value of 0, would adding or deleting other folders ever impact
DocketWorks' position and thus index value? I'm thinking no... but really
not sure.

Susan H.


> Jack:
>
> The code looks like it should work but at the line:
>
> Set TestFolder = olNameSpace.Folders.Item(FoldersArray(0))
>
> I get that same error message "The operation failed.  An object could 
> not be found."  FoldersArray(0) contains "DocketWorks".
>
> I tried passing "\\Contacts\DocketWorks\  but got the same error 
> looking for Contacts.
>
> There's something screwy with my app here.  But I can't see it.
>
> Anything else you think I could try?
>

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list