From: Blackberry on 9 Oct 2007 12:36 Hi All I'm looping an array of text into a number of cells in 1 x MS Word table via my VB6 app. To make sure each text value is on a new line of the table cell I put a carriage return/paragraph marker after it. To start with I used oDoc.Range.Text = oDoc.Range.Text & vbCrLf, but for some reason this always creates an extra return/blank line. So not to be out-done by this I thought I would use the oDoc.Range.InsertParagraph or oDoc.Range.InsertParagraphAfter commands, but for some reason even though the loop works fine for all of the other values the last text value to be put into the table always causes this 5904 error. Any ideas?
From: Rick Rothstein (MVP - VB) on 9 Oct 2007 13:18 > I'm looping an array of text into a number of cells in 1 x MS Word table > via > my VB6 app. > > To make sure each text value is on a new line of the table cell I put a > carriage return/paragraph marker after it. > To start with I used oDoc.Range.Text = oDoc.Range.Text & vbCrLf, but for > some reason this always creates an extra return/blank line. What happens if you use either vbCr or vbLf instead of vbCrLf? By the way, did you miss Robert Morley's post over in your other thread? Here is what he said over there... Just FYI, the groups... microsoft.public.vb.enterprise and microsoft.public.vb.general.discussion ....are definitely the wrong groups for Word VBA questions, and most people there won't know the answers to your question. Those groups are for VB6 and below. I see you've also posted to a couple of Word VBA groups and gotten some responses. Those are he correct place.
From: Russ on 9 Oct 2007 14:07 Hi, See below. > Hi All > > I'm looping an array of text into a number of cells in 1 x MS Word table via > my VB6 app. > > To make sure each text value is on a new line of the table cell I put a > carriage return/paragraph marker after it. > To start with I used oDoc.Range.Text = oDoc.Range.Text & vbCrLf, but for > some reason this always creates an extra return/blank line. Can you use vbCR instead of vbCRLf? > > So not to be out-done by this I thought I would use the > oDoc.Range.InsertParagraph or oDoc.Range.InsertParagraphAfter commands, but > for some reason even though the loop works fine for all of the other values > the last text value to be put into the table always causes this 5904 error. > > Any ideas? > > -- Russ drsmN0SPAMikleAThotmailD0Tcom.INVALID
From: Blackberry on 9 Oct 2007 14:18 Hi Russ Sorry to sound a bit dim, but what should I be looking at? "Russ" <drsN0SPAMmikle(a)hotmailD0Tcom.INVALID> wrote in message news:C3313BB7.1E02F%drsN0SPAMmikle(a)hotmailD0Tcom.INVALID... Hi, See below. > Hi All > > I'm looping an array of text into a number of cells in 1 x MS Word table > via > my VB6 app. > > To make sure each text value is on a new line of the table cell I put a > carriage return/paragraph marker after it. > To start with I used oDoc.Range.Text = oDoc.Range.Text & vbCrLf, but for > some reason this always creates an extra return/blank line. Can you use vbCR instead of vbCRLf? > > So not to be out-done by this I thought I would use the > oDoc.Range.InsertParagraph or oDoc.Range.InsertParagraphAfter commands, > but > for some reason even though the loop works fine for all of the other > values > the last text value to be put into the table always causes this 5904 > error. > > Any ideas? > > -- Russ drsmN0SPAMikleAThotmailD0Tcom.INVALID
From: Rick Rothstein (MVP - VB) on 9 Oct 2007 14:29
The one line that didn't start with a "previous message line" symbol. In this case... Can you use vbCR instead of vbCRLf? (It was hard to see because there were no blanks lines separating from the rest of the text.) Rick "Blackberry" <info(a)NoSpamIt.com> wrote in message news:uHOM7CqCIHA.5712(a)TK2MSFTNGP05.phx.gbl... > Hi Russ > > Sorry to sound a bit dim, but what should I be looking at? > > > "Russ" <drsN0SPAMmikle(a)hotmailD0Tcom.INVALID> wrote in message > news:C3313BB7.1E02F%drsN0SPAMmikle(a)hotmailD0Tcom.INVALID... > Hi, > See below. > >> Hi All >> >> I'm looping an array of text into a number of cells in 1 x MS Word table >> via >> my VB6 app. >> >> To make sure each text value is on a new line of the table cell I put a >> carriage return/paragraph marker after it. >> To start with I used oDoc.Range.Text = oDoc.Range.Text & vbCrLf, but for >> some reason this always creates an extra return/blank line. > Can you use vbCR instead of vbCRLf? >> >> So not to be out-done by this I thought I would use the >> oDoc.Range.InsertParagraph or oDoc.Range.InsertParagraphAfter commands, >> but >> for some reason even though the loop works fine for all of the other >> values >> the last text value to be put into the table always causes this 5904 >> error. >> >> Any ideas? >> >> > > -- > Russ > > drsmN0SPAMikleAThotmailD0Tcom.INVALID > > |