![]() |
|
#7
|
|||
|
|||
|
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
|
|
|
Similar Threads
|
||||
| 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 |
Macros to move objects prevents moving same objects with arrow keys
|
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 |
Query list of objects and properties in VBA
|
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 |