![]() |
|
#1
|
||||
|
||||
![]() Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Paul I implemented the same code after your reference link.
Would request you to check the Dcoument with code in that link. after i implemented the coding from the link it showed 70 Paras. But when the Table with rows and Columns were removed and para before the table removed it showed 13 paras in the attached document. So i wanted to know why it displayed 70 nos of paras with the table SamD |
#3
|
||||
|
||||
![]()
Simple: Your table has multiple cells (or one cell with 70 paragraphs), and each cell has one or more paragraphs. For example, suppose you have a 5*14 table. Even the empty cells have a single paragraph so far as Word is concerned. So, even if there were no paragraph breaks in the table, there would be an output for 70 paragraphs in the macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
![]() Quote:
As i began to code for what i desire Can you help me with equal nos of spacing between Style , Alignment and Font Name below is the representation in Textbox1 Quote:
How can i have equal spacing between Two Strings and later Equal spacing between Font name other Returned value of object and so on. Any kind of function to insert in code to achieve Equal spacing between the Returned value of objects leading to Neat representation I tried below with gapbetween as integer ,LEN ..... but somehow no success then used vbTab but still no success Code:
'Module1 Option Explicit Public Const minStrLen As Integer = 24 'Userform1 Private Sub ListBasicReturnedObjects() Dim StrData As String, StrSty As String, Sty As Style, strstylen As Integer Dim gapBetween As Integer Dim i As Long, j As Long, k As Long, bTabOK As Boolean, Rng As Range Dim bldFont As Boolean, strHeader As String, Pos As Integer, newPos As Integer Dim StrRecord As String strHeader = "Para No" & Space(5) & "Style" & Space(15) & "Alignment" & Space(2) & "Font Name" StrData = strHeader & vbCrLf With ActiveDocument.Range For i = 1 To .Paragraphs.Count With .Paragraphs(i) StrSty = .Style StrData = StrData & vbCr & Format(i, "#00#") & Space(8) & Mid(StrSty, 1, Len(StrSty)) strstylen = Len(Mid(StrSty, 1, Len(StrSty))) gapBetween = minStrLen - strstylen Set Sty = ActiveDocument.Styles(StrSty) If Sty.ParagraphFormat.Alignment <> .Alignment Then Else If gapBetween <= 15 Then StrData = StrData & vbTab & .Alignment & vbTab & .Range.Font.Name Else StrData = StrData & vbTab & .Alignment & vbTab & .Range.Font.Name End If End If End With Next TextBox1.Text = TextBox1.Text & StrData End With End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple found values from five sheets, multiple returned values in sheet six? | irisha | Excel Programming | 26 | 09-30-2016 01:20 AM |
![]() |
BruceM | Word VBA | 1 | 03-10-2015 08:20 AM |
List of Objects for CreateObject | excelledsoftware | Excel Programming | 4 | 09-14-2014 08:47 PM |
![]() |
bshawnr | Word VBA | 1 | 08-22-2013 11:03 PM |
Pivot Table:delete zero values when using calculated objects | Serge 007 | Excel | 1 | 06-05-2013 11:47 AM |