Solved

ms word 2007 Properties

Posted on 2009-07-02
8
283 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
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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Online collaboration can help businesses be more efficient, help employees grow their skills and foster a team environment.
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

821 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