![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
||||
|
||||
|
If you want to reference a table you're creating, use code like:
Code:
Dim Tbl as Table
....
Set Tbl = .Tables.Add(Range:=.Range.Characters.Last, NumRows:=1, NumColumns:=2, _
DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed)
With Tbl
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Thanks Paul. Working a treat.
I'm trying to get my head around the ranges and formatting still. I want to get the text bold and centered for QueryA!ConditionCategory. It's bold but it's not centering. I'm trying to work out the following.. what exactly the .range is specifying (it has no reference to a location next to it) What paragraphs.last.previous.previous doing (is it going to the last paragraph then jumping back two paragraphs to take into account the vbCr's?) how come style has a .range in front of it but alignment doesn't. (I tried putting .range in front of alignment and it didn't like it) Code:
With .Range
.InsertAfter QueryA!ConditionCategory & vbCr & vbCr
With .Paragraphs.Last.Previous.Previous
.Range.Style = wdStyleStrong
.Alignment = wdAlignParagraphCentre
End With
End With
|
|
| Tags |
| add, tables, vba |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding furigana to a Word document | rjribbit | Word | 0 | 12-03-2015 09:33 AM |
Inexperienced user having dificulty adding text to document I created. Fixed text moves around.
|
Athalwolf | Word | 2 | 02-08-2015 09:08 AM |
Error message opening a document in Word "Word cannot open this file because it is larger than 512 M
|
poonamshedge | Word | 2 | 09-11-2014 06:11 AM |
Adding and Moving parts of a document in Word
|
PauledInAction | Word | 4 | 07-13-2012 02:38 PM |
| Adding bullets in a protected Word document | Cindylu3 | Word | 0 | 10-03-2008 03:16 PM |