none
vb.net word defaultcellmargins RRS feed

  • Question

  • I'm creating a word document with several tables. I would like to be able to change the cell margins for the tables.

    In Word, I would go to Table Properties Options and fill in the top, bottom, right, left margins.  Is there a way to do this using vb.net?

    Thank you

    Rose Anna

     

    Wednesday, March 4, 2015 4:07 PM

Answers

  • Ok I finally got it to work. 

                    oTableItems.TopPadding = oWord.InchesToPoints(0.5)

    instead of

                    oTableItems.TopPadding = 0.5

    Yeah! Hope this helps someone else!!!



    • Marked as answer by ra_smith Wednesday, March 4, 2015 7:55 PM
    Wednesday, March 4, 2015 7:54 PM

All replies

  • Hello Anna,

    VSTO doesn't provide anything for that. I'd suggest asking Word specific questions on the Word for Developers forum instead.


    Wednesday, March 4, 2015 4:31 PM
  • I could really use some help here.  I've been looking all over for how to change the defaultcellmargins.  I have tried some of the answers - padding at the table level doesn't work.  It seems like it should be easy but after a week of searching and searching and searching - I'm exhausted and frustrated.   
    Wednesday, March 4, 2015 7:44 PM
  • Ok I finally got it to work. 

                    oTableItems.TopPadding = oWord.InchesToPoints(0.5)

    instead of

                    oTableItems.TopPadding = 0.5

    Yeah! Hope this helps someone else!!!



    • Marked as answer by ra_smith Wednesday, March 4, 2015 7:55 PM
    Wednesday, March 4, 2015 7:54 PM