![]() 'Document Title: Summary of meeting on Feburary 29, 2012. The code example you provided has gotten me where I wanted to be where I could at least loop through the headings or at least set up a search for the headings by name through the array. ![]() The LeftIndent property is always applied to a paragraph object. If you are programming in VBA, you can use the LeftIndent property to set this value, as shown here: 72. The following code should work for you: Sub AddParagraphs() 'Open Word Dim wordApp As Word.Application Set wordApp CreateObject('Word.Application') 'Open Dim doc As Word.document Set doc ('c:\temp\document.docx') 'Add 10 paragraphs Dim idx As Integer For idx 1 To 10 Dim paragraph As. I found that some had a total of three vbcr's, some had two, and some had one. If you are using a macro to do processing, you may want part of that processing to include setting the left indent applied to a paragraph. I found that some headings were normal, some were Headings 1. The items I modified I tried to make in red. Word.Range rngEndOfDoc Document.Content //Content returns a Range object and is a property, not a method like Range () rngEndOfDoc.Collapse () rngEndOfDoc.Text 'Text at the end of the document' Collapsing the Range is conceptually like pressing the Right (or Left) arrow key when you have a selection. Revision Tracking in VBA seems to repeat any revisions in a paragraph/sentence. MatchCase = False if case usage is inconsistent. ![]() Style 'Bold Italic' End With Next p End Sub. You can change the ArrExpr content if you want to look for something else and you can set. Sub AddCharacterStyle () Dim p As Paragraph Dim doc As Document: Set doc ActiveDocument For Each p In doc.Paragraphs p.Range.Select Selection.Collapse Direction:wdCollapseStart Selection.MoveRight Unit:wdWord, Count:2, Extend:wdExtend With Selection If. MsgBox "The following text is associated with -" & strOut Dim RngHd As Range, h As Long, i As Long, strOut As String, ArrExpr()ĪrrExpr = Array("Abstract:", "Author:", "Keywords:", "References:", "Title:")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |