"Unspecified Error" setting DisableSMAPIWarnings to True

Add-in Express™ Support Service
That's what is more important than anything else

"Unspecified Error" setting DisableSMAPIWarnings to True
"Unspecified Error" setting DisableSMAPIWarnings to True 
Paul Parkins




Posts: 8
Joined: 2005-12-16
Hi,
I'm developing an application which can perform an email mailmerge. My application uses COM to control Word to do the mailmerge. Word (presumably) uses COM to control Outlook (or whatever MAPI client installed) to do the emailing.

Whenever I attempt to set DisableSMAPIWarning (or DisableCDOWarnings) to true, I get a TOleException with a message of "Unspecified Error". I can successfully set DisableOOMWarnings to true but this does not disable the Outlook warnings for what I am doing.

Also, can I still use the "Automate Outlook" method for what I'm doing when it's really Word that I am directly automating? What would I use the "ConnectTo" with?

Product: Outlook Security Manager v1.4 (VCL)
OS: Windows XP Pro SP2
Host App: Microsoft Word 2002 (10.2627.2625)
Microsoft Outlook 2002 (10.2627.2625)
Development Tool: Borland Delphi 5 (Build 6.18) with update 1
All localisations are for UK.



Posted 16 Dec, 2005 11:19:22 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Paul,

MS Word uses either Simple MAPI or the Outlook Object Model depending on some properties of the MailMerge object. Please contact me directly by email, I will give you an example.

Posted 19 Dec, 2005 07:21:14 Top
Paul Parkins




Posts: 8
Joined: 2005-12-16
[QUOTE]
Hi Dmitry, now that with your help via email we have my application working using OSM v1.5, my users are getting error "Outlook Security Manager is not found".

Because this product is royalty free, I'd hoped that OSM would be built into my application, but it appears my users would all have to install Outlook Security Manager. I have a prelease version 1.5 of OSM, but what do I use to install onto my user's PCs so they don't get the VCL support (just the DLL), and what about licence code? I don't want to give them my developer licence code for OSM.

Regards
Paul Parkins
Posted 03 Jan, 2006 09:49:46 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Paul,

It seems you forgot to register the DLL. See the Deployment section (page 23) of the OSM Developer's Guide.

Posted 04 Jan, 2006 11:26:14 Top
Paul Parkins




Posts: 8
Joined: 2005-12-16
Hi Again Dmitry,
Sorry to have to raise this again but even though my users now have a secman.dll installed & registered, I am still getting problems when used with Word2000.

If you recall via email you sent me a pre-release v1.5 of OSM, and an updated version of my uMailMergeOOM.pas in the attachment called MailMergeTest_02.zip. Hopefully you still have this zip file. What I can say is that it all works perfectly with Word2002 for both plain text & HTML emails, even when I force it to use the Word2000 method, and for all variations listed at the bottom of this post.

With your example on Word2000 the mailmerge always failed because it loses the datasource (even though the main document already had the correct datasource embedded, and even though you added a call to OpenDataSource in my code). I have since found in the Microsoft documentation that setting MailMerge.MainDocumentType clears the datasource. However simply moving the line you added to after setting MainDocumentType does not work for me. The only way I have managed to get mailmerge to email using Word2000 working, I still get Outlook security warnings - but it works!

Below is a summary of my findings. If you can provide any advice I would be most grateful. I'm not sure if the problem is Word, OSM, or simply the order in which I'm setting properties but after 3 days this is doing my head in! :cry:

a) With your example (OpenDataSource used before MainDocumentType set), the datasource is lost.

b) If MainDocumentType is set and then OpenDataSource is used, it seems to merge to new document rather than email

c) If MainDocumentType is set, then OpenDataSource is used, then merge destination set to email, we get Outlook security warnings (but it works)

d) If MainDocumentType is not set at all (regardless of whether
OpenDataSource is used), we get Outlook security warnings (but it works)

For your information, unlike Word2002, Word2000 does not support MailMerge.MailFormat (is plain text by default), and although it does support mailmerge to email it does not support the MainDocumentType of wdEmail.

Thankyou in advance.
Regards

Paul


Posted 06 Jan, 2006 07:33:41 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Paul,

It will be very helpful if you can email me the whole test project that works with Word 2000 firing security warnings. I will test the project under Office 2000 and try to find out what happens there.

Posted 06 Jan, 2006 11:39:35 Top