How to get document margins using macros?

  1. Hi! I’m using a macro like this: var oDocument = Api.GetDocument(); var oSection = oDocument.GetFinalSection(); var nWidth = oSection.GetPageWidth(); I would like to know if there’s a way to get the margins of the currently opened document (top, bottom, left, right). Is there a method for that, or any workaround you recommend? I’m trying to get the margins because i’m using InsertAndReplaceContentControls method to insert a content control and sometimes it overflows the document

Hello @cesar.moro
Unfortunately, there is no method that would allow getting margins. You can get the margins from Layout > Margins and set the margins back with SetPageMargins method.
As far as I understand, you have already contacted colleagues of mine via the Zendesk. Please do not post the same request in different communication channels and continue the discussion via Zendesk as you have response already there.