-
Notifications
You must be signed in to change notification settings - Fork 6
Word Doc Integration
Nathan Smith edited this page Nov 15, 2025
·
1 revision
Use the Windows tray app + Ember commands to pull the active Word document into Quickfire (Business Details editor, Epic Sync, SmartPaste helpers).
| Component | Location | Notes |
|---|---|---|
| Tray command router | src/Quickfire.Tray/Methods/WordControl.cs |
Handles GetWordDocContents, logs to %LOCALAPPDATA%\Surefire\TrayLog.txt
|
| System tray | Quickfire.Tray/System/SystemTray.cs |
Registers available commands, forwards responses via SignalR (EmberHub) |
| Ember hub | src/Quickfire.Blazor/Hubs/EmberHub.cs |
Hosts SignalR endpoints for tray ↔ web app communication |
| Client components |
Domain/Clients/Components/BusinessDetailsEditor.razor.cs, Domain/Utilities/Components/EpicClientPolicySync.razor.cs
|
Register handlers, send commands |
- Web client calls
EmberService.RunEmberFunction("GetWordDocContents", new List<string>()) - EmberHub forwards the command to the connected tray app for that user
- Tray executes
WordControl.GetWordDocContents- Verifies Word is running and a document is active
- Reads the entire document body as plain text
- Handles COM errors and returns friendly error strings (
ERROR: ...)
- Tray sends results back via
SystemTray.SendEmberResponse - Web client handler receives the text and processes it (SmartPaste, Business Details parsing, etc.)
protected override async Task OnInitializedAsync()
{
EmberService.RegisterResponseHandler("GetWordDocContents", HandleWordResponse);
}
private async Task HandleWordResponse(List<string> response)
{
var text = response.FirstOrDefault();
if (text?.StartsWith("ERROR:") == true)
{
// show toast, log, etc.
return;
}
await SmartPasteFromWordAsync(text);
}
private Task RequestWordAsync()
=> EmberService.RunEmberFunction("GetWordDocContents", new List<string>());case "GetWordDocContents":
SystemControl.Log("[WordControl] Routing to GetWordDocContents");
GetWordDocContents(parameters);- Handles error scenarios: Word not running, no active doc, COM failures, empty doc
- Returns
ERROR:prefixed strings so the web client can branch easily
- Check
%LOCALAPPDATA%\Surefire\TrayLog.txtfor[WordControl]entries - Ensure the tray app is connected (status icon lit) and EmberHub shows the user connected
- Word must be the active application with a document open; macros are not required for text extraction
- Firewall/SignalR issues will show errors in browser console + tray logs
Follow the same pattern when adding more Word commands:
- Create a method in
WordControl.cs - Register it in the switch statement
- Document expected parameters + responses here
- Add client handlers in the relevant component(s)
This integration keeps Word → Quickfire flows local and fast without writing files to disk.
Quickfire Wiki • Generated from Qf-Docs/wiki • Last updated: 2025-11-14.
See the main repo for README + issues.
- Home
- Getting Started
- System Architecture
- Release Notes
- Features
- Agents & AI
- Reference
- Guides
- Integrations
- Archive