Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 04-10-2014, 07:05 AM
macropod's Avatar
macropod macropod is offline Confusion about paragraphs Windows 7 32bit Confusion about paragraphs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Sektor View Post
So, when I execute Paragraphs.Add(), I see new paragraph mark which happens to be the last one in document.
That's where your conceptual difficulty is - since you're working with the end of the document your new paragraph is inserted before the final paragraph break. You can't insert one after the final paragraph break. Thus, the one you inserted isn't the last one, but the second-last. As I said in my last post:
Quote:
You can confirm that's what happening be changing 'p.Range.Text = "par3"' to 'p.Range.Font.ColorIndex = wdRed'.
When your alternate method of referencing the last paragraph via 'Set p = .Paragraphs(.Paragraphs.Count)' is invoked, that's after you had added the new paragraph (before the final one).

PS If you want to reference the last paragraph, you could also use 'Set p = .Paragraphs.Last'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Confusion over licences Nez Office 5 02-03-2014 03:29 AM
Confusion about paragraphs Word template confusion portia Word 8 11-29-2011 02:08 PM
Confusion about paragraphs Email confusion chris29 Outlook 1 08-24-2011 01:22 PM
Confusion about paragraphs Multiple referencing confusion ridge1988 Word 2 03-31-2011 07:42 PM
Windows Update confusion Quicksilver Office 0 06-24-2010 12:33 PM

Other Forums: Access Forums

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


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