Word 2003 Mailmerge to Outlook 2003 Causes Security Warning

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

Word 2003 Mailmerge to Outlook 2003 Causes Security Warning
Word 2003 Mailmerge to Outlook 2003 Causes Security Warning 
Guest


Guest


I'm new to this tool, bought it and everyting seemed fine until I executed the following code. If the Datasorce produces a recordset with multiple recipients the first record goes with no security warning. As Soon as Record 2 fires the security warning is fired.

1. I have Disabled Security warning for all thre types of mail
2. Check Method Returns 0 for osmObjectModel, 0 for osmSimpleMAPI, but 2 for osmCDO. Is Word 2003 using Colaberative Data objects (CDO to perform its Mail merge?


wdapp.ActiveDocument.MailMerge.MainDocumentType = wdFormLetters

wdapp.ActiveDocument.MailMerge.OpenDataSource Name:=sDBPath, SQLStatement:="SELECT * FROM [Pro] WHERE Proser=" & CStr(Me.ProSer.Text)

wdapp.ActiveDocument.MailMerge.MailFormat = wdMailFormatHTML
wdapp.ActiveDocument.MailMerge.MailAddressFieldName = "ProEmail"
wdapp.ActiveDocument.MailMerge.MailSubject = strSubject
wdapp.ActiveDocument.MailMerge.MailAsAttachment = False
wdapp.ActiveDocument.MailMerge.Destination = wdSendToEmail
wdapp.ActiveDocument.MailMerge.Execute Pause:=False
Posted 16 Mar, 2005 06:48:46 Top
Dmitry Kostochko


Add-in Express team


Posts: 2745
Joined: 2004-04-05
Hi Guest,

What Outlook Security Manager version do you have installed (with build number please)? Is your Outlook running when the code is executed? Where is the code executed (in a standalone application, an add-in, etc.)?




Posted 16 Mar, 2005 08:57:21 Top
Guest


Guest


Dmitry Kostochko!
Dmitry Kostochko!

Build 1.103
Outlook Is Running, Word Application and Mailmerge Is Initiated from a Command in my Outlook Add-in created in VB6.0.

I also note that usin Your OUtlook Add-in example, Turning security Off did the same thing. Next Thing I will try will be using your Basic Add-in Example with outlook running simply execute a mail merge from Word 2003
Posted 16 Mar, 2005 10:03:35 Top
Dmitry Kostochko


Add-in Express team


Posts: 2745
Joined: 2004-04-05
I also note that usin Your OUtlook Add-in example, Turning security Off did the same thing.


What exactly do you mean? Does the second execution of the code cause security warning?

Next Thing I will try will be using your Basic Add-in Example with outlook running simply execute a mail merge from Word 2003


Ok, let's try this. Looking forward to the test results.



Posted 16 Mar, 2005 10:27:46 Top
Guest


Guest


No Single Execution of the Code. When You Execute a Mailmerge Using the Word Object model you provide a Data source. If the Data Source has more than one record. The First Email that reults from the Mail Merge to Email does not Invoke the Outlook Security However the Seconde does.

In Reference to the Test It produced the Same result.
1. Use You Sample of the Tool Snapped into Outlook 2003 and Disable the Security.

2. Create a Mail merge in Word 2003 usin Access As A data source
3. Run the Mail Merge to Email from Word and the issue occures.

More Specifically
In Your Sample tool bar Create a New Button that Executes the Code I provided Previously. You will need to Set wdapp to word application and you will need to provide a valid datasource to the wdapp.activedocument.mailmerge and you will need to set the Email field to the field in your datasource that contains the email addresses.

Let It rip and you will see what I mean.

:?: BTW, When I invoked the .Check on the CDO object I get a return code 2. What does that mean and is there any reason to think Word 2003 Mailmerge is using CDO to perform the action?

Thanks Darrell



Posted 16 Mar, 2005 13:23:33 Top
Dmitry Kostochko


Add-in Express team


Posts: 2745
Joined: 2004-04-05
Hi Darrell,

Thank you for the detailed description. I have just reproduced your situation and found the solution. Please try the following code:

Set OutlookApp = CreateObject("Outlook.Application")
Call SecurityManager.ConnectTo(OutlookApp)

SecurityManager.DisableOOMWarnings = True
wdapp.ActiveDocument.MailMerge.Execute (False)
SecurityManager.DisableOOMWarnings = True



Looking forward to your comments.


What does that mean and is there any reason to think Word 2003 Mailmerge is using CDO to perform the action?


In no case. Word 2003 uses the Outlook Object Model only.


Posted 17 Mar, 2005 06:51:51 Top
Guest


Guest


Dmitry Kostochko!
Dmitry Kostochko wrote:
Call SecurityManager.ConnectTo(OutlookApp)


I Get The Parameter is incorrect on this line of your example.

1. You Example Implies I should create another Outlook Application Instance, Connect to it With Security Manager, Turn the Warnings off, Execute the Merge, and Turn the Warnings off again. Correct?????

2. Why would Call SecurityManager.ConnectTo(OutlookApp) create the Error Parameter incorrect?
- I tried
Dim OutlookApp as object
Dim OutlookApp as Application
Dim OutlookApp as outlook.application

Thanks for the help, still not working and Im trying everything I can think of
Posted 17 Mar, 2005 17:37:49 Top
Dmitry Kostochko


Add-in Express team


Posts: 2745
Joined: 2004-04-05
Hi Darrel,

1. Yes, this is what it implies.

and Turn the Warnings off again. Correct?????

No, this is a typo. Sorry.

Set OutlookApp = CreateObject("Outlook.Application")
Call SecurityManager.ConnectTo(OutlookApp)
SecurityManager.DisableOOMWarnings = True
wdapp.ActiveDocument.MailMerge.Execute (False)
SecurityManager.DisableOOMWarnings = False

2. When testing this example I had OSM 1.2 installed (it was released yesterday). Could you please download and install this version of Outlook Security Manager.

If you email to support I will give you the full source code of the example.


Posted 18 Mar, 2005 06:37:21 Top
Guest


Guest


1. I Still Get "The Parameter is incorrect" on this line of code
Call SecurityManager.ConnectTo(OutlookApp)

2. I also Get 2 "Unspecified error" on this line of code
Note My Test sends 2 Emails
wdapp.ActiveDocument.MailMerge.Execute (False)

3. The Example you provide in line 2 has to be wdApp.ActiveDocument.MailMerge.Execute Pause:=False
(Does This have something to do with The Word Object Model your testing with? Im using the Word 11.0 Object Model Office 2003 not XP)

:-) However 1.2 did get rid of the Security warnings (-:

Please Send Source Code to XXXX@XXXX.XXX

Posted 18 Mar, 2005 09:23:33 Top
Dmitry Kostochko


Add-in Express team


Posts: 2745
Joined: 2004-04-05
Have just sent.


Posted 18 Mar, 2005 09:38:13 Top