Word Cannot Find Its Data Source ~~~.olk

J

Joost

Hi Guys,

Office 2003 Pro / OS XP Pro

A mail merge document is connected with Outlook (olk).
Every time you open this document it's connection is
lost. (and a lot of messages are coming up)
See: http://support.microsoft.com/default.aspx?kbid=275934

In Order to keep the connection working I had this little
sub:

Sub AutoOpen()
ActiveDocument.MailMerge.MainDocumentType =
wdFormLetters
ActiveDocument.MailMerge.UseAddressBook Type:="olk"
ActiveDocument.MailMerge.EditMainDocument
End Sub

This works wel in 2000.
In 2002 it works (hidden property) because of backward
compatibility,
see: http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/vbawd10/html/womscHiddenPrp2000.asp

Now in 2003 it doesn't work anymore!

In Office 2003 - using this command gives two error
message prompts: (and off coarse an VBA error)

This file needs to be opened by the Outlook Address Book
text converter, which may pose a security risk if the
file you are opening is a malicious file. Choose Yes to
open this file only if you are sure it is from a trusted
source.
(Obviously one of 2003 it's many new safety features)

Click Yes - results in the following:

A required file, SCHDMAPI.DLL could not be loaded.
Please check your email installation and re-install
Microsoft Word if necessary.

This file no longer exits on my machine because it is
part of 2002 installation and was made redundant by 2003!

Been doing an awful lot of NG searching and googling. No
success I'm afraid.
Found a lot of people with the same problem but there
doesn't seam to be an working solution attach to it.

The question is quit simple.
Is there an alternative for the code I'm using in 2003?

The goal off course is to have a mail merge document that
will stay in sync with Outlook. Therefore merging to
exported contacts is no option.

Who has got the rescuing answer?

Thnxx,
Joost
 
J

Joost

Hi Graham,

Thank you for answering!

I'll try you're workaround.
What do you think of MS Making a property redundant in
2003 (Backward compatible in 2002), and not giving an
alternative?

Usualy there is always an alternative to code you use in
the VBE, but this one doesn't seem to have one.

Again thank's for you're help!

Regards,
Joost
 
J

Joost

Again hi, ;-)

Totally happy with the alternative!
This is a better way of merging Outlook contacts, yep for
sure!

Still a little pissed off at Bill, but that will fade
away! ;-) (should be possible to merge with Word in the
same way without confirmation displays)

Tnxx,
Joost
 
P

Peter Jamieson

Probably not much help now, but FWIW you can still use

ActiveDocument.MailMerge.UseAddressBook Type:="olk"

(i.e. the method UseAddressBook is still there, but hidden), but you do
have to have a copy of SCHDMAPI.DLL from (say) Office XP as you say. If
you have that, you can either connect using

ActiveDocument.MailMerge.UseAddressBook Type:="olk"

or by selecting a dummy file with extension "olk" as your data source.
You do get a dialog box to select your address list.
 
G

Guest

Hi Peter,

Don't underestimate you're answer! ;-)

This is exactly the answer I was hoping for! (an
alternative for Bill's decision)
Yes I have a copy of that DLL, and I was certainly
thinking about using it. Seams trivial but I was afraid
it would mess up my system if I where just to put in
there.

So Thank you very much indeed for this answer!

But still need some help implementing this Workaround.

The original path of this DLL is: (XP)
C:\Program Files\Microsoft Office\Office10\1043
\SCHDMAPI.DLL

I think this comes close in 2003:
C:\Program Files\Microsoft Office\OFFICE11\1043
(Office 10 is XP Office 11 is 2003)

So I think I've got the location worked out. But still
I'd like some confirmation about registering this DLL.
Do I, ore don't I use Regserv32 to register it?

The workaround Graham told me works great for new merges
but I've got these merge documents connected to several
different address-books with the extension "olk"

So Yes this will be the ultimate solution!

Regards,
Joost
 
P

Peter Jamieson

I think this comes close in 2003:
C:\Program Files\Microsoft Office\OFFICE11\1043
(Office 10 is XP Office 11 is 2003)

That's where I put it, except I'm using 1033 (one of the varieties of
English).
So I think I've got the location worked out. But still
I'd like some confirmation about registering this DLL.
Do I, ore don't I use Regserv32 to register it?

At first, copying SCHDMAPI.DLL did not work at all. I don't know why -
perhaps I needed to shut down Word or and restart. I tried registering the
DLL, just in case, but regsvr32 came up with a "missing entry point" error.
I looked through the registry on my Office 10 system and could only find
a. entries related to the Office installer (i.e. they would only be used
during an install/re-install, not at runtime)
b. one entry somewhere under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
Messaging Subsystem\MSMapiApps (I think). However, this was already there on
my Office 11 machine.

I hope it does what you need - as I said, I am prompted for a specific
address book and that may be one of the things you are trying to avoid. Much
as I would like to have an address book connection method that can be
initiated from Word and "does everything", the "initiation from Outlook"
approach has been the best choice for most purposes for several years now.
 
P

Peter Jamieson

I think this comes close in 2003:
That's where I put it, except I'm using 1033 (one of the varieties of
English).

Hmm, I forgot that I must have either moved it or copied it to my Windows
directory at some point. In which case it would probably be better off in
the Windows\System32 directory.
 
J

Joost

Hi Peter,

First of all thank you so much for you're efforts in
helping me!

What have I done:
* Put the Dll in: C:\Program Files\Microsoft
Office\OFFICE11\1043 (Dutch language)
* Used: regsvr32 C:\Program Files\Microsoft
Office\OFFICE11\1043\SCHDMAPI.DLL to register the DLL
I also receive an error: LoadLibrary("C\Program") failed -
The specified module could not be found. (Note the DLL
is in Place)
* Rebooted the PC

Used the suggested code in an AutoOpen procedure.
Started the document.
* First macro confirmation
* Second choose address-book
* Warning DLL could not be found
* VBA Error. (witch is logic)

So things have stayed the same.

Do you have any suggestions?
I wanted to look at the registry but you weren't to
specific on if I should use this ore not. (because you
didn't confirm any would work so I want to be careful
with the registry)

Again thank you

Regards,
Joost
 
P

Peter Jamieson

Hi Joost,

sorry, I forgot, and my other post didn't make it to the server yesterday (I
move around too much!).

I eventually put the dll in c:\windows - that's what probably made it work.

c:<your windows directory>\system32 might be a more appropriate place.

I will be away for the next week BTW.
 
G

Graham Mayor

I have been following this with some interest, and can confirm Peter's
suggestion to put the DLL in the system32 folder. This works for me to kill
the error message and allows the merge to proceed. The DLL does not need to
be registered, it works from the moment it is placed.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Joost

Hi Peter & Graham,

Thanks for the pit-bull approach! ;-)

Finally there is no DLL Error, still some windows to
confirm but case closed I would say!

I to can confirm that putting the DLL in System32
resolves the error. (and yes seams strange but no
registration required)

HTH,
Joost
 
G

Graham Mayor

Word 2003 can be a bit pedantic about data files. You may be able to lose
the prompts about finding the data if you put the data file in the folder
defined at
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\DataServices.
Unfortunately I have not found a way to enter any folder here with a path -
yet. The folder is by default a sub directory of My Documents called My Data
Sources, but you can change this to another sub directory of My Documents
and that's about it.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top