Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ms word 2007 Properties

Posted on 2009-07-02
8
Medium Priority
?
288 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
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
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)…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 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