Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Trigger the Properties Dialog box on open

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack_Feeman - 03 Oct 2006 18:52 GMT
This is slightly different than some of the other questions on the group.

We are developing a template for drafting over 2000 instruction documents.
Since most of our user base have never correctly used templates and we want
the flow to be as smooth as possible; we are putting as much repetitive
information into properties as we can.

Of course, we will instruct them on our to use the template; but judging
from past experience....  We thought if we opened the properties dialog box
for them when they opened the template it would increase our odds that they
will use it.

Our problem is that while recording the macro, we have to close the dialog
box before stopping the recorder and then it has nothing written to it when
we do.

How can we automatically open the Properties dialog box when a user opens
the template?

Thanks
Jay Freedman - 03 Oct 2006 21:29 GMT
Put the following maro into a regular module of the template:

Sub AutoNew()
   Const wdDialogFileProperties = 750
   On Error Resume Next ' in case of Cancel
   Dialogs(wdDialogFileProperties).Show
End Sub

If you want the dialog to open also when an existing document based on the
same template is opened, make another copy of the macro in the same module
and change its name to AutoOpen.

The constant declaration is needed because, for reasons I never understood,
Microsoft didn't define a built-in constant to represent the File >
Properties dialog. There is one for wdDialogFileSummaryInfo, which is a
useless cut-down version. <shrug>

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> This is slightly different than some of the other questions on the
> group.
[quoted text clipped - 17 lines]
>
> Thanks
Jean-Guy Marcil - 03 Oct 2006 21:51 GMT
Jack_Feeman was telling us:
Jack_Feeman nous racontait que :

> This is slightly different than some of the other questions on the
> group.
[quoted text clipped - 15 lines]
> How can we automatically open the Properties dialog box when a user
> opens the template?

I think you meant to ask how to activate that dialog when creating a
document form the template, not when opening the template itself.
This particular dialog is not part of the Dialogs collection... go figure!

So you need a workaround.
Also, when displaying the dialog through VBA, if the user hits "Cancel" you
get an annoying error message. This is why I sorta trap the error in the
code below.

Paste this code in the ThisDocument module of your template. IF you want the
dialog only when creating a document (Not when subsequently opening it, do
not use the Document_Open.

'_______________________________________
Private Sub Document_New()

On Error Resume Next
WordBasic.FileProperties
On Error GoTo 0

End Sub
'_______________________________________

'_______________________________________
Private Sub Document_Open()

On Error Resume Next
WordBasic.FileProperties
On Error GoTo 0

End Sub
'_______________________________________

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Jack_Feeman - 04 Oct 2006 12:38 GMT
Thanks for the great responses and for your insights as well. Yes, only
opening the dialog box on the creation of a new document from the template is
a great way to do this.

Thanks again, Jack

> Jack_Feeman was telling us:
> Jack_Feeman nous racontait que :
[quoted text clipped - 51 lines]
> End Sub
> '_______________________________________
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.