The With Statement


The With statement is used to simplify accessing complex data types. Listing 16 defines a data type that contains two different values: first name and last name. You can access these values by placing a period between the variable name and the data item.

 Dim oProp As New com.sun.star.beans.PropertyValue oProp.Name = "Age"          'Set Name Property oProp.Value = "Amy Boyer"   'Set Value Property 

The With statement provides a shortcut for accessing multiple data elements from the same variable.

 Dim oProp As New com.sun.star.beans.PropertyValue With oProp   .Name = "Age"          'Set Name Property   .Value = "Amy Boyer"   'Set Value Property End With 



OpenOffice.org Macros Explained
OpenOffice.org Macros Explained
ISBN: 1930919514
EAN: 2147483647
Year: 2004
Pages: 203

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net