# DocumentObject.Command Method

> DocumentObject.Command method in the TX Sheet Control .NET API: Creates or updates a document-bound handle or queued operation.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > DocumentObject > DocumentObject.Command Method
- **762 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/documentobject/command-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/documentobject/command-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/documentobject/command-method/llms-full.txt

---

Creates or updates a document-bound handle or queued operation; the owning workbook retains validation authority.

### Syntax

```csharp
public ObjectCommand Command(string method, object?[] args)
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `method` | `string` | No | Operation-specific input; see this type's units and ownership contract. |
| `args` | `object?[]` | No | Operation-specific input; see this type's units and ownership contract. |

### Return Value

`ObjectCommand`. The operation result, returned asynchronously.

### Examples

Create commands from a document-owned cell and apply them together through Workbook.BatchAsync.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateInvoiceHeadingAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    DocumentObject heading = sheet.Cell("A1");
    await book.BatchAsync(batch =>
    {
        batch.Add(heading.Command("setText", "October invoice"));
        batch.Add(heading.Command("format", new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" }));
    });

    return await control.SaveAsync(StreamType.PDF);
}
```

### Remarks

Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.

### See Also

- [DocumentObject Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/documentobject/llms-full.txt)
- [Loading and Saving Workbooks](https://docs.textcontrol.com/tx-sheet-control/document-processing/load-save/llms-full.txt)
- [ObjectCommand Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/objectcommand/llms-full.txt)

---

## Nearby

- **Previous:** [DocumentObject Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/documentobject/llms-full.txt)
- **Next:** [DocumentProperties Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/documentproperties/llms-full.txt)
