logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

MsOffice::Word::Surgeon::Field - internal representation for a MsWord field

Author

       Laurent Dami, <dami AT cpan DOT org<gt>

Description

       This is used internally by MsOffice::Word::Surgeon for storing a MsWord field.

Methods

new
         my $field = MsOffice::Word::Surgeon::Field(
           xml_before  => $xml_string,
           code        => $code_instruction_string,
           result      => $xml_fragment,
           status      => 'begin',
         );

       Constructor for a new field object. Arguments are :

       xml_before
           A  string  containing arbitrary XML preceding that field in the complete document.  The string may be
           empty but must be present.

       code
           A code containing the instruction string for that field.  If the instruction string contains embedded
           fields, these are represented through the "show_embedded_field" in MsOffice::Word::Surgeon syntax  --
           by default, just a pair of curly braces.

       result
           An XML fragment corresponding to the last update of that field in MsWord.

       status
           One of "begin", "separate", or "end".

           Status  "begin"  or "separate" are intermediate, used internally during the parsing process. Normally
           all fields are in "end" status.

   add_to_code
       While parsing fields, additional field instruction fragments are added through this method

   add_to_result
       While parsing fields, additional XML fragments belonging to the  field  result  are  added  through  this
       method

   type
       The  first  instruction  in the "code" part, eg "REF", "QUOTE", "ASK", "DOCPROPERTY", etc.  Note : in the
       Microsoft                   Word                   Object                   Model,                    the
       <https://learn.microsoft.com/en-us/office/vba/api/word.field.type|Field.Type>  attribute  is  an  integer
       value in an enumerated type. Here the attribute is just an uppercase string. Lists of valild field  types
       can be found in the Word documentation.

Name

       MsOffice::Word::Surgeon::Field - internal representation for a MsWord field

See Also