Link to home
Start Free TrialLog in
Avatar of robertsmith28
robertsmith28

asked on

Word Automation - paragraphs and bullets

I'm using Excel '97 to produce a report in Word '97. I'm exporting data from the Excel file to the report. The main difficulty I'm having understanding the InsertAfter statements and exactly how to just put some text at the end of the current document or format the text which I've just inserted. For example, I want to loop through a cloumn of cells until they are blank, putting the contents of each cell as a new paragraph, sequencially and each one of them with a Bulletpoint:

dim wordapp as word.application
dim worddoc as word.document
Set wordapp = CreateObject("Word.Application")
Wordapp.Documents.Add
Set WordDoc = wordapp.ActiveDocument
do while Trim(Range(Chr(intRow +65) & 1)).Value <> ""
WordDoc.Content.MoveEnd

WordDoc.Content.InsertAfter Worksheets("Sheet1").Range(Chr(intRow+65 &65).value

'some code which will put a formatted bulletinfront of the above?

loop

Please state if clarifcation is required....
Any comments greatly appreciated.
Avatar of robertsmith28
robertsmith28

ASKER

oops, forgot to add some bits into the loop

introw = 1
do while...
..
..
..
..
intRow = intRow + 1
Loop
Hi robert,

I posted a question in the MS Office topic area for you, pointing to this one.

Nosterdamus
Nosterdamus,
Thanks - so have I - did n't realise which area I was in - oops!
Should I delete my link question?
Actually it was my other misplaced question! Thanks - just leave I reckon.
ASKER CERTIFIED SOLUTION
Avatar of calacuccia
calacuccia
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
P.S. I changed the Chr(IntRow + 65) & 3 a little to match my sample sheet I was working on.
Hi cal,

Nice to see you again... ;-)

Nosterdamus
calacuccia,
That looks great - I'll just try to implement it - back in an hour or two...
Rob.
calacuccia,
That looks great - I'll just try to implement it - back in an hour or two...
Rob.
Hi Rob,

Just a hint. to avoid multiple postings, use the Reload Question link at the top of the page, instead of hitting the Browser's reload button.

Nosterdamus
Thanks calacuccia, as always, was exactly what I was looking for - excellent!
ThAnks, robert.

Regards
calacuccia
calacuccia,
this one's also in the wrong area for 70 - FYI.

https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=msaccess&qid=20164520