How can I change orientation to landscape only in the pages of a word document that have tables?

Hidden paragraphs! Wow! What else is there. It worked now! Thank you! I appreciate it! :smiley:

1 Like

I would like to except table with text Πίνακας αιτούμενων ποσών from changing orientation in sections with tables (this is in page 183 of the input word document). How should I do that? I tried to add n.Range.Text != “Πίνακας αιτούμενων ποσών” to the if statement, but this is not functioning. How should I do this?

@panCognity You can use Contains:

// Loop through the tables in the document.
foreach (Node n in doc.GetChildNodes(NodeType.Any, true))
{
    // process only nodes, which are direct children of body.
    if (n.ParentNode.NodeType != NodeType.Body)
        continue;

    if (n.ToString(SaveFormat.Text).Contains(@"Πίνακας αιτούμενων ποσών"))
        continue;

...........................................
1 Like

So, i should use contains with SaveFormat.Text. Thank you for your help! :smiley:

@panCognity Yes, you should use Contains since "Πίνακας αιτούμενων ποσών" is not the only text of the node.

1 Like

I was trying with n.Range.Text, but then I saw n.ToString(SaveFormat.Text), which is more proper this way. Thanks again!

1 Like