Advertisement

04.25.2008 at 08:54AM PDT, ID: 23353945
[x]
Attachment Details

Determine if a number is odd or even

Asked by ALawrence007 in .Net Editors & IDEs, Microsoft Word

Tags: Visual Basic

Hi,

How can I determine if a number is odd or even? I am using the following code to determine my page numbers in a word document, but I need to know if the number is odd or even.

 Dim lPageCnt As Long, lPgNr As Long

            lPageCnt = oWordApplication.ActiveDocument.ComputeStatistics(WdStatistic.wdStatisticPages)
            For lPgNr = 1 To lPageCnt
                Call oWordApplication.Selection.GoTo(WdGoToItem.wdGoToPage, , , CStr(lPgNr))
                With oWordApplication.ActiveDocument.Shapes.AddLine(307, 73, 307, 709).Line
                    .DashStyle = Microsoft.Office.Core.MsoLineDashStyle.msoLineSolid
                End With
            Next lPgNr

ThanksStart Free Trial
[+][-]04.25.2008 at 08:56AM PDT, ID: 21440783

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 09:00AM PDT, ID: 21440815

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Microsoft Word
Tags: Visual Basic
Sign Up Now!
Solution Provided By: gregoryyoung
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.25.2008 at 09:01AM PDT, ID: 21440829

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628