-
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
-
default apps
by
chasfinn
5 hours, 44 minutes ago -
Will MS Works 4 work in MS Win 11?
by
MileHighFlyer
4 hours, 5 minutes ago -
Adding links to text in Word 2000
by
sgeneris
15 hours, 13 minutes ago -
FBI warnings are true—fake file converters do push malware
by
Nibbled To Death By Ducks
8 hours, 25 minutes ago -
Classic and Extended Control Panel — no need to say goodbye
by
Deanna McElveen
1 hour, 16 minutes ago -
Things you can do in 2025 that you couldn’t do in 2024
by
Max Stul Oppenheimer
8 hours, 51 minutes ago -
Revisiting Windows 11’s File Explorer
by
Will Fastie
39 minutes ago -
Planning ahead for migration
by
Susan Bradley
7 hours, 59 minutes ago -
Yahoo mail getting ornery
by
Tom in Az
1 hour, 35 minutes ago -
Is Spectrum discontinuing email service?
by
Peobody
2 hours, 49 minutes ago -
Practice what you preach! A cautionary tale.
by
RetiredGeek
49 minutes ago -
Looking for Microsoft Defender Manuals/Tutorial
by
blueboy714
34 minutes ago -
Win 11 24H2 Home or Pro?
by
CWBillow
1 day, 8 hours ago -
Bipartisan Effort to Sunset the ‘26 Words That Created the Internet’..
by
Alex5723
2 days, 6 hours ago -
Outlook new and edge do not load
by
cHJARLES a pECKHAM
2 days, 18 hours ago -
Problem using exfat drives for backup
by
Danmc
2 days, 19 hours ago -
I hate that AI is on every computer we have!
by
1bumthumb
1 day, 21 hours ago -
Change Info in the Settings window
by
CWBillow
3 days, 1 hour ago -
Attestation readiness verifier for TPM reliability
by
Alex5723
3 days, 8 hours ago -
Windows Update says that “some settings are managed b your organization”
by
Ed Willers
2 days, 17 hours ago -
Use of Gmail rejected.
by
CBFPD-Chief115
2 days, 18 hours ago -
WuMgr operational questions
by
Tex265
18 hours, 24 minutes ago -
Beijing’s unprecedented half-marathon: Humans vs. humanoids!
by
Alex5723
3 days, 23 hours ago -
New Phishing Campaign Targeted at Mac Users
by
Alex5723
3 days ago -
Backing up Google Calendar
by
CWBillow
4 days, 6 hours ago -
Windows 11 Insider Preview build 27818 released to Canary
by
joep517
4 days, 18 hours ago -
File Naming Conventions (including Folders)
by
Magic66
3 days, 17 hours ago -
Windows 11 Insider Preview Build 26100.3613 (24H2) released to Release Preview
by
joep517
5 days, 2 hours ago -
Microsoft sends emails to Windows 10 users about EOS
by
Alex5723
4 days, 12 hours ago -
Outlook 2024 importing Calendar and Contacts – FAILURE
by
Kathy Stevens
3 days, 18 hours ago
Recent blog posts
- Classic and Extended Control Panel — no need to say goodbye
- Things you can do in 2025 that you couldn’t do in 2024
- Revisiting Windows 11’s File Explorer
- Planning ahead for migration
- Woody Leonhard (1951–2025)
- What I learned from Woody Leonhard
- Windows Settings today
- Mail Merge magic in Microsoft Word
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.