#1   Report Post  
Posted to microsoft.public.word.docmanagement
lhc lhc is offline
external usenet poster
 
Posts: 1
Default Command Failure

I receive a message "Command Failure" each time I attemp to use the following
code to close a document:

On Error GoTo errorHandler
ActiveDocument.Close _
SaveChanges:=wdPromptToSaveChanges, _
OriginalFormat:=wdPromptUser
errorHandler:
If Err = 4198 Then MsgBox "Document was not closed"

The code without the error handler under debug gives a "Command Failure"
message.

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default Command Failure

Hi ?B?bGhj?=,

I receive a message "Command Failure" each time I attemp to use the following
code to close a document:

On Error GoTo errorHandler
ActiveDocument.Close _
SaveChanges:=wdPromptToSaveChanges, _
OriginalFormat:=wdPromptUser
errorHandler:
If Err = 4198 Then MsgBox "Document was not closed"

The code without the error handler under debug gives a "Command Failure"
message.

Is there a document open? If you use just ActiveDocument.Close (no parameters)
does that work?

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 :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Failure to merge [email protected] Mailmerge 2 May 21st 07 09:20 PM
get data failure Curt Mailmerge 1 February 11th 07 09:58 AM
Engine Failure MegBoschetti06 Mailmerge 2 November 10th 06 08:43 AM
Failure to print Don K. Microsoft Word Help 5 January 3rd 06 03:43 AM
Smart tag failure Dovid Microsoft Word Help 1 March 17th 05 01:11 PM


All times are GMT +1. The time now is 11:11 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"