Solved

ms word 2007 Properties

Posted on 2009-07-02
8
286 Views
Last Modified: 2012-05-07
can i create document templates that force a user to fill in the properties before they are allowed to save the file. Also how would i enforce a naming convention for the filename say xx.anything.xxx.xx.doc  with the xx being specific date like numbers or letters.
0
Comment
Question by:vannyx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 3

Expert Comment

by:hemaltrivedi
ID: 24771317
Hi Vannyx,

Here is a possible solution in Word 2007:

Firstly, you need to get down to some VBA coding and call a function on Document_Close() event which checks whether the required properties have been set or not. If not, then don't allow the user to close the document. The code may look like:

If Trim(ActiveDocument.BuiltInDocumentProperties("Title").Value) = "" Then
    MsgBox "Title not provided"
    ActiveDocument.Saved = False   'Dont save the document
    SendKeys "{ESC}"                     'Send the ESC key to avoid showing the save dialog box to users
else
    ActiveDocument.Saved = True       'Save the document
End If

You can also check for other properties like Author, Title, etc if those are mandatory for your case.

If you want to allow your users to enter values in the document itself and change the properties, you can insert those fields into the document. The following link shows how to add the document properties into the document:

http://vbadud.blogspot.com/2009/01/how-to-insert-document-properties-in.html

The second part of saving the file with a particular convention would require another line of code:

ActiveDocument.SaveAs (filenm)

where you can define filenm as something like:

filenm = "XYZ" & "." & cstr(month(now())) & "-" & cstr(year(now()))
or whatever you want

Note: Using SaveAs, a different copy gets created everytime. To avoid this, you can write some further code to check whether the file already exists. If yes, then simply use ActiveDocument.Saved=True. If you wish, you may also have the file created with required name, on the document open event.

Hope that helps

Hemal
0
 

Author Comment

by:vannyx
ID: 24772411
So this would be coded into the template?  It doesnt need to be enforced onces the document is saved as, just on the first save we want the user to input certain properties and we dont want them to be able to save changes to the template without a password.
0
 
LVL 3

Expert Comment

by:hemaltrivedi
ID: 24773274
Well, you are right. This has to go into a template. But then the users need to use this template only. If they create documents from normal template then this approach won't work.

Hemal
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 3

Expert Comment

by:hemaltrivedi
ID: 24791619
Did the solution work? a feedback would be helpful.
0
 

Author Comment

by:vannyx
ID: 24803056
i havent tried it, its a little over my head and il need some time to try to figure it out.  Right now with my project load i dont have time.  I basically want to have something that is easy for the end user.  Because someone else is proposing a program called mfiles, which is a nice program but doesnt seem to scale very well and it also doesnt put any of the meta data in the actual document.  It also requires an agent and special interface to use it.
0
 

Author Comment

by:vannyx
ID: 25440265
couldnt find a solution that was easy to use.  Can i have this question refunded ?
0
 
LVL 3

Expert Comment

by:hemaltrivedi
ID: 25446183
Did you atleast try the solution provided? This will atleast give you a start. I agree its not foolproof but once the template is used, you will have the desired results. The only thing you need to take care is to establish a practice of having the users use the template.

Hemal
0
 

Accepted Solution

by:
vannyx earned 0 total points
ID: 25880084
couldnt find a solution that was easy to use.  Can i have this question refunded ?
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question