Word Document Properties in VB.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • santuvssantu
    New Member
    • Jun 2007
    • 12

    #1

    Word Document Properties in VB.NET

    Can any one give me the correct way to get this?

    I am trying to set, for example, the "Different Odd & Even Page
    Header" property in a Word doc.
    I have a word document object m_WordDoc.

    I am trying ...
    m_WordDoc.PageS etup.OddAndEven PagesHeaderFoot er = 1;

    .... but get error msg
    System.Argument Exception: The parameter is incorrect,
    at Microsoft.Offic e.Interop.Word. PageSetup.set_O ddAnd EvenPagesHeader Footer
    (Int32 prop) at <...goes on to provide code location...>

    Should I be using an accessor method in this code, or am I just
    missing something ... if so, is there an example available?

    Thanks for any assistance,
    Santu.
  • DeMan
    Top Contributor
    • Nov 2006
    • 1799

    #2
    Hi santuvssantu,

    Welcome to TSDN. I will move this question onto some experts that may be better qualified to answer this question. While the link to this thread will remain in this forum, you can access a variety of forums by selecting from the options on the pulldown menuson the blue bar near the toip odf the screen.

    I hope the experts can help you out!

    Comment

    • jasperz01
      New Member
      • Jun 2007
      • 20

      #3
      Originally posted by santuvssantu
      Can any one give me the correct way to get this?

      I am trying to set, for example, the "Different Odd & Even Page
      Header" property in a Word doc.
      I have a word document object m_WordDoc.

      I am trying ...
      m_WordDoc.PageS etup.OddAndEven PagesHeaderFoot er = 1;

      Thanks for any assistance,
      Santu.
      m_WordDoc.PageS etup.OddAndEven PagesHeaderFoot er = True

      should work i think :) It's a boolean so it won't accept 0 or 1 as a value.

      Jasper

      Comment

      • santuvssantu
        New Member
        • Jun 2007
        • 12

        #4
        Hi,
        I got it using
        m_WordDoc.PageS etup.OddAndEven PagesHeaderFoot er = -1

        0 for False.
        -1 is for true.

        Thanks.

        Comment

        Working...