removeSection

removeSection

ADVANCED / PREMIUM BASIC

Removes a section and its contents.

Description
public removeSection (string $source, string $target, int $section, [array $options])

This method allows you to remove a section and its contents in a Word document.

Parameters

source

Path to the Word document.

target

Path to the resulting document.

section

Section number to be removed: 1, 2...

options

The possible keys and values are (required options are shown with yellow background):

Key Type Description
keepSections bool Preserve or not the original sections of the splitted document. If false uses the first section for all documents. Default as true.
Return values

Void.

Code samples

Example #1