4D v13

WR SET DOCUMENT INFO

Home

 
4D Write v13
WR SET DOCUMENT INFO

WR SET DOCUMENT INFO 


 

WR SET DOCUMENT INFO ( area ; title ; subject ; author ; company ; comment ) 
Parameter Type   Description
area  Longint in 4D Write area
title  String in Title of the document
subject  String in Document subject
author  String in Author of the document
company  String in Company name
comment  Text in Comment

The WR SET DOCUMENT INFO command stores in the document the information that is passed in the parameters. From a user standpoint, the information is displayed in the Document information dialog box. You can access that dialog by selecting Document information in the Tools menu.

To manage the document lock status, refer to WR LOCK DOCUMENT.

Example  

You want users to be able to modify only the Title, Subject and Comment of the document information. You need to implement a method that intercepts the selection of menu commands and display your own customized form when users select Document information from the Tools menu.

1. In the form method of the form that contains the 4D Write area, place the following code to intercept the menu command:

 Case of
    :(Form event=On Load)
       WR ON COMMAND(WArea;"z65OnCmd")
 End case

2. The method 'z65OnCmd' is the following:

 C_LONGINT($1;$2;$3)
 Case of
    :($2=wr cmd doc information`=801, if the user selects Tools>Document Information...
       DIALOG([TheTable];"InfoArea") `Custom Information form
    Else
       WR EXECUTE COMMAND($1;$2`If the user selects any other menu command
 End case

3. In the customized Information form, named "InfoArea", only the variables vTitle, vSubject and vComments are editable. Here is the method attached to this form:

 Case of
    :(Form event=On Load)
       WR GET DOCUMENT INFO(WArea;vTitle;vSubject;vAuthor;vCy;vComments;DCreat;HCreat;DModif;
       HModif;Lock)
  `You assign the empty elements if necessary
       If(vCy="")
          vCy:="A.C.I."
          vAuthor:=Current user
          vCreation:=String(DCreat)+" at "+Time string(HCreat)
          vModification:=String(DModif)+" at "+Time string(HModif)
       End if
    :(Form event=On Unload`When the form is closed
       WR SET DOCUMENT INFO(WArea;vTitle;vSubject;vAuthor;vCy;vComments)
 End case

 
PROPERTIES 

Product: 4D
Theme: WR Documents
Number: 89488

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Write 6.5

 
SEE ALSO 

WR GET DOCUMENT INFO