Skip to main content

Split a Word document into separate files at each bookmark

The following example will demonstrate how to split a Word document (.docx, .doc) at each bookmark.

If the document contains 1 bookmark, all the content up until the bookmark will be saved to a new document. This means the left over content will be disregarded. If you wish to split the entire document, please ensure the document ends with a bookmark.

You can view the full Swagger documentation here.

Request

curl --location --request POST 'https://word-api.doclabs.cloud/api/v1/DocumentIWantToSplit.docx/split/atbookmarks?storageName=MyBucketName' \
--header 'x-api-key: MY_API_KEY'

Response

{
"bucketName": "MyBucketName",
"contentPathNames": [
"FirstDocument.docx",
"SecondDocument.docx",
"ThirdDocument.docx"
]
}