Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using OLE, it looks like you can get the justification (or alignment) via the <code>ParagraphFormat2</code> object, which has an <code>Alignment</code> property. Here's an example from the OLE docs:</p> <pre><code>ActivePresentation.Slides(1).Shapes(2).TextFrame2.TextRange2.ParagraphFormat2.Alignment </code></pre> <p>You can read more about this object <a href="http://msdn.microsoft.com/en-us/library/office/ff870379%28v=office.14%29.aspx" rel="nofollow">here</a>.</p> <p>To provide a Perl example of this, take a look at this example:</p> <pre><code>use strict; use warnings; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; use Win32::OLE::Variant; my $word = Win32::OLE-&gt;GetActiveObject('Word.Application') || Win32::OLE-&gt;new( 'Word.Application', 'Quit' ); $word-&gt;{Visible} = 1; my $doc = $word-&gt;{Documents}-&gt;Open('&lt;full path to file&gt;'); print $doc-&gt;Paragraphs(1)-&gt;{Alignment} . "\n"; $doc-&gt;Close(); </code></pre> <p>You'll need to install the <code>Win32::OLE</code> library on a machine with Microsoft Word installed on it, at minimum. When writing Perl applications to use OLE, anything that is an OLE object is a method call and anything that is a OLE member is a hash reference.</p> <p>When you go to open the file, you'll need to provide the full path to the file, i.e. 'C:\\folder\\doc.docx'. Change the number passed to <code>Paragraphs</code> for whichever paragraph you want (in OLE arrays start at 1.)</p> <p>The <code>Alignment</code> key will return an int, which correspondes to a <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.wdparagraphalignment%28v=office.11%29.aspx" rel="nofollow"><code>WdParagraphAlignment Enumeration</code></a>. I was able to test this out; 0 => Left, 1 => Center, 2 => Right, 3 => Justified.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload