|
-
Oct 1st, 2009, 05:05 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] how to align a table in Word VB.net 2008
Hello, I have a word document created in VB.net, but I need to do is center align the table (but not the contents of it). the contents has their own alignments arranged, so how to align the table itself. this way I am putting it into the middle of the page so it would look better.
I got this to align the cells:
Code:
oTableHdng.Cell(1, 1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
I tried this to align the table but it doesn't do anything, besides this apply to paragraphs so that's probably not what I need but I couldn't find anything else:
Code:
oTableHdng.Range.Paragraphs.Alignment = WdParagraphAlignment.wdAlignParagraphCenter
Last edited by MrtforCode; Oct 1st, 2009 at 05:09 AM.
-
Oct 1st, 2009, 07:53 AM
#2
Re: how to align a table in Word VB.net 2008
Hi I don't have access to vb.net at the moment but try something like this
Selection.Tables(1).Rows.Alignment = wdAlignRowCenter
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 1st, 2009, 08:34 AM
#3
Thread Starter
Fanatic Member
Re: how to align a table in Word VB.net 2008
that really helped, works, thanks a lot
Code:
oTableHdng.Range.Tables(1).Rows.Alignment = WdRowAlignment.wdAlignRowCenter
-
Oct 1st, 2009, 09:20 AM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|