Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 08-12-2016, 05:51 AM
gmaxey gmaxey is offline table and code accidentally working only on odd rows Windows 7 32bit table and code accidentally working only on odd rows Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Marco, Graham,

The following also worked with Marco's example tables (a's, b's and c').

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oPar As Paragraph
Dim oRng As Range
Dim dblSize As Double
  For Each oPar In ActiveDocument.Paragraphs
    Set oRng = oPar.Range
    With oRng
      .MoveEnd wdCharacter, -1
      Do While .ComputeStatistics(wdStatisticLines) > 1
        dblSize = .Font.Size
        oRng.Font.Size = dblSize - 0.5
        If oRng.Font.Spacing > -0.3 Then oRng.Font.Spacing = oRng.Font.Spacing - 0.05
      Loop
    End With
  Next oPar
lbl_Exit:
  Exit Sub
End Sub
Still I am perplexed as to why I can select the first a, the last a, the first b, the last b, the first c and the then the last c and get the following results with

?Selection.Information(wdFirstCharacterLineNumber) in the Immediate windows

1
3
6
6
7
8

That indicates that the paragraphs containing the b's, the tiny empty paragraph after it and the paragraph containing the text "Test 2" is all contained within the same line and clearly visually at least it is not.

What makes this cell containing 3 paragraphs different from the other 2 or why is .Information(wdFirstCharacterLineNumber) reporting erratically in this case?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
table and code accidentally working only on odd rows I want to add multiple rows into my document but I can not figure out the code jlw15931 Mail Merge 1 02-24-2015 05:03 AM
table and code accidentally working only on odd rows Header Rows in Tables Not Working Andy Pilkington Word 2 10-10-2014 12:36 AM
table and code accidentally working only on odd rows Is it possible to copy non-contiguous rows of a Table and paste them as a separate Table in Word? Joey Cheung Word Tables 1 08-12-2014 05:15 PM
table and code accidentally working only on odd rows VBA Code to take data from a table in word document and place it in a summary table VBLearner Word VBA 1 03-09-2014 08:42 PM
table and code accidentally working only on odd rows Grouping table rows to prevent individual rows from breaking across pages dennist77 Word 1 10-29-2013 11:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:03 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft