Дело в том, что если в документа больше трёх страниц, то у меня почему-то всё время выводится значение "3". Если меньше трёх — то выводится то, что есть на самом деле... Подскажите, в чем тут дело?
Дело в том, что если в документа больше трёх страниц, то у меня почему-то всё время выводится значение "3". Если меньше трёх — то выводится то, что есть на самом деле... Подскажите, в чем тут дело?
Здравствуйте, Julia.K, Вы писали:
JK>Дело в том, что если в документа больше трёх страниц, то у меня почему-то всё время выводится значение "3". Если меньше трёх — то выводится то, что есть на самом деле... Подскажите, в чем тут дело?
А Файл->Свойства закладка Статистика сколько страниц показывает, это по идее то же самое?
SYMPTOMS
When you use a macro to insert page breaks in a document and then return a page count by using the BuiltInDocumentProperties property, the number of pages returned may be incorrect.
CAUSE
The document needs to be repaginated before you return the number of pages.
To work around this problem, use the Repaginate method to force document repagination before calling the BuiltInDocumentProperties(wdPropertyPages) property. For example:
Sub GetNumberOfPages()
ActiveDocument.Repaginate
MsgBox ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
End Sub
Здравствуйте, Elena_, Вы писали:
E_>Здравствуйте, Julia.K, Вы писали:
JK>>Смотрела счетчик количества слов — все верно показывает. Не пойму в чем дело...
E_>Может быть, это поможет
E_>MSDN WD2000: BuiltInDocumentProperties Returns Incorrect Page Count Q212653
E_>
E_>SYMPTOMS
E_>When you use a macro to insert page breaks in a document and then return a page count by using the BuiltInDocumentProperties property, the number of pages returned may be incorrect.
E_>CAUSE
E_>The document needs to be repaginated before you return the number of pages.
E_>To work around this problem, use the Repaginate method to force document repagination before calling the BuiltInDocumentProperties(wdPropertyPages) property. For example:
E_>
E_> Sub GetNumberOfPages()
E_> ActiveDocument.Repaginate
E_> MsgBox ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
E_> End Sub
E_>