Open properties box on close

M

Mark Cann

Hi,
I'm in no way a programmer but I have a programming type query.

Is it possible to force Word to open the Document Properties box either on
saving the said document or closing the document using macros or vba or
something?

Thanks in advance

MC
 
J

Jay Freedman

Mark said:
Hi,
I'm in no way a programmer but I have a programming type query.

Is it possible to force Word to open the Document Properties box
either on saving the said document or closing the document using
macros or vba or something?

Thanks in advance

MC

Hi Mark,

All you need is a simple option setting. In Tools > Options > Save, check
the box "Prompt for document properties". Since Word will prompt for a save
if the document is dirty when you close it, that will cover all the bases.
 
R

Ronnie

Hi Jay,
I had set the option setting as in Tools > Options > Save, check the box
"Prompt for document properties. But Word still does not prompt me whenever
I'm trying to re-save an existing documents. btw, what do you means by "if
the document is dirty when you close it, that will cover all the bases."

Regards
 
K

Klaus Linke

Hi Ronnie,

The option setting only forces the file properties dialog the first time you
save a doc (and not every time the doc has changed = "is dirty", as Jay
likely assumed).
You'd need an AutoClose macro -- The one below isn't terribly elegant, but
avoids dealing with event handlers:

Sub AutoClose()
Dim myDoc As Document
Set myDoc = ActiveDocument
Application.EnableCancelKey = wdCancelDisabled
If ActiveDocument.Saved = False Then
Select Case _
MsgBox("Do you want to save the changes?", _
vbQuestion + vbYesNoCancel, _
myDoc.Name)
Case vbYes
Dialogs(750).Show
myDoc.Save
myDoc.Close
Case vbNo
myDoc.Saved = True
myDoc.Close
Case vbCancel
SendKeys "{ESC}"
End Select
Else
myDoc.Close
End If
Application.EnableCancelKey = wdCancelInterrupt
End Sub

Greetings,
Klaus
 

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