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
Paul would you recommend any good online tutorials or books to work through to improve my vba basics. I feel stupid asking these questions but it's really hard to try and understand what to do just using online msdn. So far I just hash together bits and pieces I find on the internet and sort of fluke that they function to some degree.