Hello Experts,
I will like to seek your help in getting the requirement completed, but got stuck in a problem of formatting the MS word table. review the requirement list
Requirement:- I am trying to copy a range from MS Excel to Ms word with defined formating (color, size, font, indentation & much more).
Problem statment: I want to decrease the left indentation of the bullets points in the cell of a table, I am looping throug columns
Code used:
Sub main()
Set myCol = WordTable.Columns(5)
For Each cel In myCol.Cells
cel.Select
If cel.RowIndex <> 1 Then
Cel_txt = cel.Range.Text
'Additional
If InStr(1, Cel_txt, "•") >= 1 Then
cel.Range.Text = VBA.Trim(Cel_txt)
cel.Range.ListFormat.ApplyBulletDefault
Call DecreaseRIndent(cel)
WordTable.AutoFitBehavior (wdAutoFitContent)
End If
End If
Next cel
end sub
other function
Function DecreaseRIndent(ByRef cel As Variant)
Dim sDefaultIndent As Single
Dim sCalcul As Single
Dim opara As Paragraph
sDefaultIndent = -0.01
cel.Range.Select
With Selection
Set opara = cel.Range.Paragraphs.first
'sCalcul = CentimetersToPoints(sDefaultIndent)
sCalcul = InchesToPoints(sDefaultIndent)
'If sCalcul < 0 Then sCalcul = 0
opara.LeftIndent = sCalcul
End With
End Function
Seeking your Advice, please help