Back to Devexpress

CalculateDocumentVariableEventArgs.VariableName Property

officefileapi-devexpress-dot-xtrarichedit-dot-calculatedocumentvariableeventargs-d2d6a149.md

latest5.4 KB
Original Source

CalculateDocumentVariableEventArgs.VariableName Property

Gets the name of the document variable to which the DOCVARIABLE field refers.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public string VariableName { get; }
vb
Public ReadOnly Property VariableName As String

Property Value

TypeDescription
String

A string that is the name of the document variable in the DOCVARIABLE field.

|

Remarks

The VariableName property enables you to identify a document variable for which the Document.CalculateDocumentVariable event is fired.

The following code snippets (auto-collected from DevExpress Examples) contain references to the VariableName property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-create-a-master-detail-report/CS/RichEditMasterDetailMailMerge/Form1.cs#L76

csharp
//Check whether the event is raised to the required field:
if (e.VariableName == "Categories")
{

wpf-richedit-use-docvariable-fields/CS/MainWindow.xaml.cs#L73

csharp
Console.WriteLine(e.VariableName + " " + location);

word-document-api-create-master-detail-report/CS/Program.cs#L68

csharp
{
    if (e.VariableName == "IMAGE")
    {

how-to-use-docvariable-fields/CS/DocumentVariablesExample/Form1.cs#L81

csharp
}
switch (e.VariableName) {
    case "Weather":

word-document-api-use-docvariable-fields/CS/Program.cs#L57

csharp
}
switch (e.VariableName)
{

winforms-richedit-create-a-master-detail-report/VB/RichEditMasterDetailMailMerge/Form1.vb#L71

vb
'Check whether the event is raised to the required field:
If e.VariableName = "Categories" Then
    'Provide the data source for the next document part:

wpf-richedit-use-docvariable-fields/VB/MainWindow.xaml.vb#L71

vb
Dim location As String = e.Arguments(0).Value.ToString()
Console.WriteLine(e.VariableName & " " & location)
If(Equals(location.Trim(), String.Empty)) OrElse location.Contains("<") Then

word-document-api-create-master-detail-report/VB/Program.vb#L69

vb
Private Sub WordProcessor_OnCalculateDocumentVariable(sender As Object, e As CalculateDocumentVariableEventArgs)
    If e.VariableName = "IMAGE" Then
        Dim pictureProcessor As New RichEditDocumentServer()

how-to-use-docvariable-fields/VB/DocumentVariablesExample/Form1.vb#L81

vb
Select Case e.VariableName
    Case "Weather"

word-document-api-use-docvariable-fields/VB/Program.vb#L46

vb
Select Case e.VariableName
    Case "Weather"

See Also

CalculateDocumentVariable

CalculateDocumentVariableEventArgs Class

CalculateDocumentVariableEventArgs Members

DevExpress.XtraRichEdit Namespace