A word vba subroutine to list the left and right indent of all paragraphs of the document.
- User
A word vba subroutine to list the left and right indent of all paragraphs of the document.
Assistant
Sure, here is a VBA subroutine that lists the left and right indent of all paragraphs in a document:
Sub ListIndents() ' Declare variables Dim doc As Document Dim para As Paragraph Dim leftIndent As Integer Dim rightIndent As Integer ' Set the document object Set doc = ActiveDocument ' Loop through each paragraph For Each para In doc.Paragraphs ' Get the left and right indents leftIndent = para.Range.Indent rightIndent = para.Range.RightIndent ' Print the indents Debug.Print "Paragraph " & para.Number & ": Left indent = " & leftIndent & ", Right indent = " & rightIndent Next para End Sub
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.