Solved

ms word 2007 Properties

Posted on 2009-07-02
8
280 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
  • 4
  • 4
8 Comments
 
LVL 3

Expert Comment

by:hemaltrivedi
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 3

Expert Comment

by:hemaltrivedi
Comment Utility
Did the solution work? a feedback would be helpful.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:vannyx
Comment Utility
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
Comment Utility
couldnt find a solution that was easy to use.  Can i have this question refunded ?
0
 
LVL 3

Expert Comment

by:hemaltrivedi
Comment Utility
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
Comment Utility
couldnt find a solution that was easy to use.  Can i have this question refunded ?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In a previously published article (http://www.experts-exchange.com/articles/10331/Automatic-Duplex-Scanning-in-PaperPort-Versions-11-12-14.html) here at Experts Exchange, I explained how to achieve duplex (double-sided) scanning in Nuance's PaperPor…
In a previous article here at Experts Exchange (http://www.experts-exchange.com/articles/18414/Create-a-PDF-file-with-Contact-Sheets-montage-of-thumbnails-for-all-JPG-files-in-a-folder-and-each-of-its-subfolders-using-an-automated-batch-method.html)…
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…
This video Micro Tutorial is the first in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles al…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now