Can i use dotm files with phpdocx ? Because there is a start ne section allways on uneven page option in word.
The problem is that, if i activate this in the template, word will add two useless blank pages if the pagecount is even. if it is odd, it works as desired. So my idea was to write a macro in word that counts the pages on save and, if the count is odd, activates this option.
Would that be possible?
Here my Macro:
Sub oddPageNumber(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim count As Integer
Dim rest As Integer
count = ActiveDocument.ComputeStatistics(wdStatisticPages)
rest = count Mod 2
If rest > 0 Then
Selection.InsertBreak Type:=wdSectionBreakEvenPage
End If
End Sub