Wednesday, 15 September 2010

VBA WORD Labels at start at end of selection -


I'm trying to select text and add some labels at the start / end, and some stuff in each paragraph, but I do not know why this happens:

  Sub Test Bonton () as DIM P paragraph, I, in the form of integer, total as integer, as the range set R = selection Overall = Selection Paragraph Total = P = R for I = 1 Paragraph (i) p. Range. Text = "***" & amp; P.Range.Text Next r.Text = "((BOTONES))" & amp; Crowe (13) & amp; R. Text & amp; Crowe (13) & amp; "((Bottles))" & amp; Chr (13) debug Print R. Paragraph Closing sub  

As you can see, you debug this macro. In the print line, the number of paragraphs decreases after 1 is coming out for loop ... why ??

Try to fix this task :)

 <<> Sub TESTBotones () As the paragraph of dim p, I select the integer as the total, in the form of an integer, r = selection as the range set. Total = Select. Paragraph Total set for = I = 1 = p = r Paragraph (I) p. "***" ahead of the Range.install.InsertBefore "((BOTONES))" & amp; Crowe (13) R. Insert Effort Crowe (13) & amp; "((Bottles))" & amp; Chr (13) debug Print r.Paragraphs.Count End Sub  

No comments:

Post a Comment