-
WSCecilia
AskWoody LoungerSeptember 21, 2007 at 11:36 pm in reply to: Global Address List (Outlook/Exchange) in Access (2002) #1076463Yes, but it also says that you can write code using ADO or DAO to get the custom properties out of it.
I’m just desperately trying to come up with the right code, but nothing is working.
If I find a solution, I’ll share it. I’m still working on it.
-
WSCecilia
AskWoody LoungerSeptember 21, 2007 at 11:33 pm in reply to: Global Address List (Outlook/Exchange) in Access (2002) #1076459(Edited by HansV to make URL clickable – see Help 19)
Well, that is what is happening to me. After much searching, this article confirms what was going on: http://www.outlookcode.com/article.aspx?ID=25%5B/url%5D
Thanks anyway!
-
WSCecilia
AskWoody LoungerSeptember 21, 2007 at 11:19 pm in reply to: Global Address List (Outlook/Exchange) in Access (2002) #1076455Okay….do you know if there is any way I can get the other properties from Exchange? Then I could build a table and have it synch on a regular basis. I suppose that’s better than nothing….
Here is some code for contacts that is in the MSKB, but I can’t figure out the magic code to change it to the global address list. I get an error every time.
Sub ImportContactsFromOutlook()
‘ This code is based in Microsoft Access.
‘ Set up DAO objects (uses existing “tblContacts” table)
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset(“tblContacts”)‘ Set up Outlook objects.
Dim ol As New Outlook.Application
Dim olns As Outlook.Namespace
Dim cf As Outlook.MAPIFolder
Dim c As Outlook.ContactItem
Dim objItems As Outlook.Items
Dim Prop As Outlook.UserPropertySet olns = ol.GetNamespace(“MAPI”)
Set cf = olns.GetDefaultFolder(olFolderContacts)
Set objItems = cf.Items
iNumContacts = objItems.Count
If iNumContacts 0 Then
For i = 1 To iNumContacts
If TypeName(objItems(i)) = “ContactItem” Then
Set c = objItems(i)
rst.AddNew
rst!FirstName = c.FirstName
rst!LastName = c.LastName
rst!Address = c.BusinessAddressStreet
rst!City = c.BusinessAddressCity
rst!State = c.BusinessAddressState
rst!Zip_Code = c.BusinessAddressPostalCode
‘ Custom Outlook properties would look like this:
‘ rst!AccessFieldName = c.UserProperties(“OutlookPropertyName”)
rst.Update
End If
Next i
rst.Close
MsgBox “Finished.”
Else
MsgBox “No contacts to export.”
End IfEnd Sub
-
WSCecilia
AskWoody LoungerI think that is ultimately the solution. I thought I had everything set up the way you said, but it just doesn’t work easily, and ultimately, I can’t get the exact charts they want. Okay, my new question: Can you suggest a tutorial on Excel graphs? The ones this person used are CLEARLY not standard, and I can’t figure out how he made them.
-
WSCecilia
AskWoody LoungerI just had a side thought.
Is it at all possible to put the actual Excel chart object (which I assume is an OLE object?) into Access? And then change the datasource of that somehow?
-
WSCecilia
AskWoody LoungerOkay, I think I’ve figured out that what I need to do *isn’t* necessarily scatter graphing, it’s just the fancy name/word of the day that the supervisor wants to call it (dufus). At least that I can’t get names going across the X axis (ie. plotted?), but I can with a line column chart. Ugggh, all that has taken me since 8am this morning!
Your mini tutorial is excellent! Thank you!!! Now I need to go further.
What I’ve got is a list of stores, in regions, with their sales, target sales, and the number of hours they’re open in the month. It looks like this:
Region Store Sales TargetSales Hours Cafe East A 1100 1200 200 T East B 1120 1000 150 F
You get the picture.
I’m trying to create a graph that compares sales to target sales, and then adds data for the number of hours on there (with a y axis on the right side scaled to the number of hours–just for the heck of it lol). To put a bigger quirk in it, I need separate graphs per region (or at least I should be able to program the data source to change with a drop down box, so I can see the different regions?). And then the original Excel graphs have two parts to them, they have a small graph grouping together stores that have cafes and then a line and then the rest are the stores that don’t have cafes.
Now that I’ve written that all out…ugggh…I’m going back to try to work with your example to be able to change the region. I think if I can get past that…it’s a huge hurdle…I still have to do the other impossible parts, but I will feel better if I can figure out how to program the change in region….
-
WSCecilia
AskWoody LoungerHah! So easy, but so hard to find.
Perfect, that’s exactly it!!!
I think I wanna be just like Hans when I grow up
-
WSCecilia
AskWoody LoungerOkay, automation is being used. I won’t be stubborn anymore.
Now, if I want to run code…what do I use?
If I want to run a macro, apparently I can do DoCmd.RunMacro (“MyMacro”)
Do I need a macro for ever function I want to run this way? Or can I call the actual procedures?
-
WSCecilia
AskWoody LoungerThanks, Hans.
For some reason, I can’t refer to it in references…okay, I’ll stop being lazy and open my database
Edit: I can’t do it in references, because I want all the action to be done in the external databases. I just want to be able to control them from one command center.
-
WSCecilia
AskWoody LoungerSorry, I missed the nuance in what I was trying to say…you are right.
The document that works doesn’t have the message about enabling macros in the template at all…so that’s still a difference.
But if you don’t get the last one, where it asks if you want to save changes to the template, then it’s clearly my pc. Ugggh.
I really do appreciate the help, and I will try to remember to say Open a new document based on a template.
-
WSCecilia
AskWoody LoungerThanks! I’ll change it to automation and see if it makes a difference.
-
WSCecilia
AskWoody Lounger>>Set doc = .Documents.Add(strTemplate, , , True)
does NOT open the template as a document. It creates a new document based on the template.<>If you still have the Word.Application object, you should not use Shell to start Word, but
.Documents.Open(strDocName)<<
Actually, the Word.application object is closed by then, and the user has come back to view the document he made previously. That's why I switched to shell.
You don't need the Access portion to see this happen. Simply make a document based on the template and save it and close it. When you go back to open the document again, you'll get the message asking if you want to enable macros on the template, but the document name will properly appear at the top of the form. If you make a change in the form, upon closing you'll be prompted to save changes to the template.
But I understand if you're busy….
-
WSCecilia
AskWoody LoungerThe Access Part:
Here is what I’m using to create the document from the template:
Set doc = .Documents.Add(strTemplate, , , True)
this line follows immediately:
doc.SaveAs strDocName
In the case of re-opening the existing-made-from-template document (which is when I have the problem), I am using this line:
Call Shell(“winword.exe ” & strDocName, vbMaximizedFocus)
I am calling the same routines for opening both documents and just passing a different document or template name, so the fact that the behavior is different for the two different templates leads me to believe the problem is in the templates.
-
WSCecilia
AskWoody LoungerExactly. I’ve got the terminology straight.
What’s going on is I’m opening the template as a document from Access and saving it immediately in a predetermined folder with a predetermined name (made from Access data).
The form that works properly, works properly, in that the predetermined name of the document shows up on the top of the document. When you close the form, if you’ve made no changes to the document, it closes with no fuss, and if you’ve made changes, it asks do you want to save the document.
The form that works improperly (the attachment) DOES show the name of the document in the top, except during the Enable Macros portion, you are asked if you want to enable the macros from the .dot file. When you close the document, you are asked if you want to save changes to the .dot file.
Does that make more sense?
Edit: How do people attach screenshots to posts? I would post the screenshot if I could.
-
WSCecilia
AskWoody LoungerHey, Hans…If you happen to have a spare moment….another question, same form, probably similar problem….
So I had two of these forms that pretty much do the same thing. One of them works perfectly fine. The other one, if I open it as a document and then save it and close it…then go back to open it again, it gives me the message “are you sure you want to open your WordTemplate.dot” and on closing, “do you want to save changes to your WordTemplate.dot” instead of wanting to save to the document.
Is there possibly something else that is a bit bonkers in the form? What should I look for?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
53 minutes ago -
Where’s the cache today?
by
Up2you2
16 hours, 13 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
8 hours, 59 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
10 hours, 44 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
16 hours, 55 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
1 day, 9 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 day, 9 hours ago -
regarding april update and may update
by
heybengbeng
1 day, 11 hours ago -
MS Passkey
by
pmruzicka
13 hours ago -
Can’t make Opera my default browser
by
bmeacham
1 day, 18 hours ago -
*Some settings are managed by your organization
by
rlowe44
1 day, 5 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day, 17 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
2 days, 13 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
2 days, 22 hours ago -
AI slop
by
Susan Bradley
16 hours, 15 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
2 days, 23 hours ago -
Two blank icons
by
CR2
7 hours, 48 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
9 hours, 45 minutes ago -
End of 10
by
Alex5723
3 days, 11 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 days, 9 hours ago -
test post
by
gtd12345
3 days, 17 hours ago -
Privacy and the Real ID
by
Susan Bradley
3 days, 7 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 9 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
3 days, 21 hours ago -
Upgrading from Win 10
by
WSjcgc50
2 days, 9 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
2 days, 12 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
4 days, 13 hours ago -
The story of Windows Longhorn
by
Cybertooth
4 days ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
4 days, 15 hours ago -
Are manuals extinct?
by
Susan Bradley
1 day, 15 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.