# Export Office Documents to Google Workspace

Export Word, Excel, and PowerPoint documents to Google Docs, Sheets, and Slides, import them back, and work with Drive through one shared session.

**Packages**

- [OfficeIMO.GoogleWorkspace](https://www.nuget.org/packages/OfficeIMO.GoogleWorkspace) `dotnet add package OfficeIMO.GoogleWorkspace`
- [OfficeIMO.Word.GoogleDocs](https://www.nuget.org/packages/OfficeIMO.Word.GoogleDocs) `dotnet add package OfficeIMO.Word.GoogleDocs`
- [OfficeIMO.Excel.GoogleSheets](https://www.nuget.org/packages/OfficeIMO.Excel.GoogleSheets) `dotnet add package OfficeIMO.Excel.GoogleSheets`
- [OfficeIMO.PowerPoint.GoogleSlides](https://www.nuget.org/packages/OfficeIMO.PowerPoint.GoogleSlides) `dotnet add package OfficeIMO.PowerPoint.GoogleSlides`
- [OfficeIMO.GoogleWorkspace.Drive](https://www.nuget.org/packages/OfficeIMO.GoogleWorkspace.Drive) `dotnet add package OfficeIMO.GoogleWorkspace.Drive`

**Works with**

- .NET
- [PowerShell](/docs/pswriteoffice/install/) `Install-Module PSWriteOffice`

**Target frameworks**

netstandard2.0, net8.0, net10.0, net472

**APIs**

- [`GoogleWorkspaceFidelityPolicy`](/api/google-workspace/officeimo-googleworkspace-googleworkspacefidelitypolicy/)
- [`TranslationReport`](/api/google-workspace/officeimo-googleworkspace-translationreport/)
- [`WordDocument`](/api/word/officeimo-word-worddocument/)
- [`GoogleDocsSaveOptions`](/api/word-google-docs/officeimo-word-googledocs-googledocssaveoptions/)
- [`GoogleDocumentReference`](/api/word-google-docs/officeimo-word-googledocs-googledocumentreference/)
- [`GoogleServiceAccountCredentialSource`](/api/google-workspace/officeimo-googleworkspace-googleserviceaccountcredentialsource/)
- [`GoogleWorkspaceSession`](/api/google-workspace/officeimo-googleworkspace-googleworkspacesession/)
- [`GoogleWorkspaceSessionOptions`](/api/google-workspace/officeimo-googleworkspace-googleworkspacesessionoptions/)

**Cmdlets**

- [`New-OfficeGoogleWorkspaceSession`](/api/powershell/new-officegoogleworkspacesession/)
- [`Export-OfficeWordGoogleDocument`](/api/powershell/export-officewordgoogledocument/)

**Limits**

[OfficeIMO.Word.GoogleDocs support matrix](/compatibility/#package-word-googledocs), [OfficeIMO.Excel.GoogleSheets support matrix](/compatibility/#package-excel-googlesheets), [OfficeIMO.PowerPoint.GoogleSlides support matrix](/compatibility/#package-powerpoint-googleslides)

**Verified**

Examples compiled against the source on 2026-11-14

**Data**

- [OfficeIMO.GoogleWorkspace API index](/api/google-workspace/index.json)
- [OfficeIMO.Word.GoogleDocs API index](/api/word-google-docs/index.json)
- [OfficeIMO.Excel.GoogleSheets API index](/api/excel-google-sheets/index.json)
- [OfficeIMO.PowerPoint.GoogleSlides API index](/api/power-point-google-slides/index.json)
- [OfficeIMO.GoogleWorkspace.Drive API index](/api/google-workspace-drive/index.json)
- [PSWriteOffice command catalog](/data/powershell/commands.json)
- [Capability catalog (JSON)](/data/capabilities.json)

`OfficeIMO.GoogleWorkspace` holds the session, credentials, transport, retries, diagnostics, and fidelity policy. Format packages translate one OfficeIMO document type each: `OfficeIMO.Word.GoogleDocs`, `OfficeIMO.Excel.GoogleSheets`, and `OfficeIMO.PowerPoint.GoogleSlides`. `OfficeIMO.GoogleWorkspace.Drive` covers files and folders, `OfficeIMO.GoogleWorkspace.Auth.GoogleApis` adapts Google client-library credentials, and `OfficeIMO.GoogleWorkspace.Sync` reads change feeds.

| You want to | Page |
|---|---|
| Create a session from a service account, token, or Google APIs credential | [Authenticate to Google Workspace](/docs/google-workspace/authentication/) |
| Export Word to Google Docs or import a Google Doc | [Export and Import Google Docs](/docs/google-workspace/docs/) |
| Export Excel to Google Sheets or import a spreadsheet | [Export and Import Google Sheets](/docs/google-workspace/sheets/) |
| Export PowerPoint to Google Slides | [Export and Import Google Slides](/docs/google-workspace/slides/) |
| List, upload, download, or share Drive files | [Manage Google Drive Files](/docs/google-workspace/drive/) |
| Target a shared drive | [Work with Google Shared Drives](/docs/google-workspace/shared-drives/) |
| Track Drive changes and apply a sync plan | [Track Google Drive Changes](/docs/google-workspace/sync/) |
| Check what each translator supports | [Google Workspace support matrix](/docs/google-workspace/support/) |

## Create a session and export a document

Every translator can build a local plan before it touches Google. `TranslationReport` entries carry a stable code, source path, severity, chosen action, and count, and `GoogleWorkspaceFidelityPolicy` decides whether errors or warnings stop the operation.

### C#

```csharp
using OfficeIMO.GoogleWorkspace;
using OfficeIMO.Word;
using OfficeIMO.Word.GoogleDocs;

using var credentials = GoogleServiceAccountCredentialSource.FromFile("service-account.json");
var session = new GoogleWorkspaceSession(credentials, new GoogleWorkspaceSessionOptions {
    ApplicationName = "Reporting service",
    DefaultFolderId = "folder-id",
    MaxRetryCount = 5,
    DiagnosticSink = entry => Console.WriteLine($"{entry.Severity}: {entry.Message}")
});

using WordDocument document = WordDocument.Load("report.docx");
GoogleDocumentReference created = await document.ExportToGoogleDocsAsync(session,
    new GoogleDocsSaveOptions { Title = "Quarterly report" });

Console.WriteLine(created.FileId);
```

### PowerShell

```powershell
$session = New-OfficeGoogleWorkspaceSession -KeyPath .\Secrets\reporting.json -Scope Documents, DriveFile
try {
    Export-OfficeWordGoogleDocument -Path .\report.docx -Session $session
} finally {
    $session.CredentialSource.Dispose()
}
```

## Update an existing file safely

Import or read the target first, keep its `RevisionId` (Docs, Slides) or `DriveVersion` (Sheets), and pass it back in the replace options. The replacement fails if the file changed in between. Overwrite modes exist, but only as an explicit choice. Drive change feeds tell you what to look at; they do not replace the format-specific replacement checks.

<!-- PowerForge markdown source sha256:EDE7663564DC63D083FBE78D58E1E41271E4D9F26C25054D128254BA6AAA1735; title=True -->

<!-- PowerForge markdown artifact sha256:EFB5BC47A2F01B270D7C46CD1F15BE7F474CED7EFE159BEE51BCB80910CD8FB0 -->
