locked
How to insert specific fields on Word 2003 and 2007? RRS feed

  • Question

  •    Hello, I want to insert three fields on any new documents that users produce in Word and Excel 2003 and 2007. These are the fields:

       1- On field that is the name of the employee that is creating the document. Could it take the name of the user from its logged session?

       2- A second field that is the category of the document (confidential, restricted, free, etc). Can be a dropdown menu.

       3- A field that contains the "Distribution list" for this document. We want to build this list by offering a field to the user so it can access the GAL contacts from Word (outlook must be opened), pick-up the users and at the end they will be listed in front of the "Distribution list" label.

       Main questions:

       A) How to solve the three questions above? Is there a better that is not the one that I listed above?

       B) How could I guarantee that this "new kind of controlled documents" are being used by the users? Changing all the "templates" docs that exists in Word and Excel? Need to reinstall Office for that or can I change it other way?

       Best regards, Eduardo.

     

     

    Monday, April 4, 2011 3:43 PM

All replies

  • I think that you need a userform.  See the following pages of Greg Maxey's website :

    http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

    http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm
     See the article "How to get the username of the current user” at:
    http://www.word.mvps.org/FAQs/MacrosVBA/GetCurUserName.htm

    To populate a listbox or combobox on a userform with data from Outlook use:

    Here's an example that fills a listbox on a userform. You'll need a
    reference in the Visual Basic Editor to the Outlook library in order to run
    this:
    ----------------------------------- Dim i As Integer
    Dim oOutlookApp As Outlook.Application
    Dim oOutlookNameSpace As Outlook.NameSpace
    Dim oContacts As Outlook.MAPIFolder
    Dim oContact As Outlook.ContactItem
     On Error Resume Next
     Set oOutlookApp = GetObject(, "Outlook.Application")
     If Err <> 0 Then
       Set oOutlookApp = CreateObject("Outlook.Application")
     End If
     Set oOutlookNameSpace = oOutlookApp.GetNamespace("MAPI")
     'Get the contactfolder
     Set oContacts = oOutlookNameSpace.GetDefaultFolder(olFolderContacts)
     For Each oContact In oContacts.Items
       Me.ListBox1.AddItem oContact.LastNameAndFirstName
       i = i + 1
     Next
     Set oContact = Nothing
     Set oContacts = Nothing
     Set oOutlookNameSpace = Nothing
     Set oOutlookApp = Nothing
    -----------------------------------  -- Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "EEOC" wrote in message news:56ccdac9-efa3-4727-bba4-96bd08e49f26@communitybridge.codeplex.com...

       Hello, I want to insert three fields on any new documents that users produce in Word and Excel 2003 and 2007. These are the fields:

       1- On field that is the name of the employee that is creating the document. Could it take the name of the user from its logged session?

       2- A second field that is the category of the document (confidential, restricted, free, etc). Can be a dropdown menu.

       3- A field that contains the "Distribution list" for this document. We want to build this list by offering a field to the user so it can access the GAL contacts from Word (outlook must be opened), pick-up the users and at the end they will be listed in front of the "Distribution list" label.

       Main questions:

       A) How to solve the three questions above? Is there a better that is not the one that I listed above?

       B) How could I guarantee that this "new kind of controlled documents" are being used by the users? Changing all the "templates" docs that exists in Word and Excel? Need to reinstall Office for that or can I change it other way?

       Best regards, Eduardo.




    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    Monday, April 4, 2011 7:59 PM
  •   Hello Doug, thanks for your response. In the meanwhile I studied more to do the right questions. Here I go:

      xxxxxxxxxxxxxxxxx

       At first, let me give you some context:
       1- We don't have SharePoint but will have in Q4/2011.
       2- We will (very soon) have Office 2007 Std. deployed in our environment (no InfoPath 2007).
       3- We don't have plans to put AD RM (Rights Management).

       We want to insert 3 fields in DIP for "soft" confidentiality control (who wrote de document, degree of confidentiality and distribution list). This fields should be inserted in Word 2007, Excel 2007 and Power Point 2007 templates so we can create documents and fill this fields in DIP from Word, Excel and Power Point.

       Given the following articles http://office.microsoft.com/en-us/word-help/add-property-information-to-a-document-HA010163766.aspx and http://msdn.microsoft.com/en-us/library/ms545650%28v=office.12%29.aspx it seems that one can just insert custom fields to be used in DIP if he has SharePoint or InfoPath in place.
       Questions:
       1- Is it right or can I use just ONE license of Infopath 2007 (no SharePoint server, as stated in context area) to create the DIP for Word 2007, Excel 2007 and Power Point 2007 documents and distribute to the company as a template so everybody that create a new document would see and fill the customized DIP information?
       2- As this kind of operation would insert fields in a existing DIP, that would be considered as a customized DIP? If so, the limitation from the second article applies ("Custom document information panels are displayed only in Office Professional 2007 and Office Enterprise 2007 applications"), as we will have almost Office 2007 in Std. Edition?

      xxxxxxxxxxxxxxxxx

      Thanks and best regards, EEOC.

    Wednesday, April 13, 2011 1:34 PM