Surpressing Dialogs in 2007 during automation

S

Stretchcoder

I have Visual C++ automating various versions of Word.

I apply Encryption options and add a password, then save the doc.

I get this dialog in 2007 when I try to save a doc that was first created in
Word 97.

"This document is both encrypted and password protected. The Office Open XML
Formats available in the 2007 release provide stronger encryption. Do you
want to increase the security of this document by converting to an Office
Open XML format?"

If I click no everything works fine... the problem is I don't want my user's
seeing Word at all... any idea how to supress this popup?

Thanks!

My code is as follows (simplified since I am using late binding and it's
gross to look at)

get the Application...


result = InvokeWithParams(pApp, _T("Visible"), DISPATCH_PROPERTYPUT,
&vargResult, 1, vFalse);

result = InvokeWithParams(pApp, _T("DisplayAlerts"),DISPATCH_PROPERTYPUT,
&vargResult, 1, vAlertLevel);

result = InvokeWithParams(pDocs, _T("Open"), DISPATCH_METHOD, &vargResult,
1, docName);

result = InvokeWithParams(pDocument, _T("SetPasswordEncryptionOptions"),
DISPATCH_METHOD, &vargResult, 4, vEncryptProperties, vKeyLength, vAlgorithm,
vProvider);

result = InvokeWithParams(pDocument, _T("Password"), DISPATCH_PROPERTYPUT,
&vargResult, 1, vPassword);

result = InvokeWithParams(pDocument, _T("Save"), DISPATCH_METHOD,
&vargResult, 0);
***I get the dialog box here***
close
quit, etc
 
C

Cindy M.

Hi =?Utf-8?B?U3RyZXRjaGNvZGVy?=,

Have you tried setting Application.DisplayAlerts?

How about use the SaveAs method, rather than "plain old Save"?
I have Visual C++ automating various versions of Word.

I apply Encryption options and add a password, then save the doc.

I get this dialog in 2007 when I try to save a doc that was first created in
Word 97.

"This document is both encrypted and password protected. The Office Open XML
Formats available in the 2007 release provide stronger encryption. Do you
want to increase the security of this document by converting to an Office
Open XML format?"

If I click no everything works fine... the problem is I don't want my user's
seeing Word at all... any idea how to supress this popup?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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