View Single Post
 
Old 03-18-2016, 06:55 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
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 rpb925 View Post
1) The three of you have provided different solutions for setting the range for the table;
gmayor; You have defined a variable Orng = doc.Range
macropod; you have used .Characters.Last which I like cause my simple vba mind can make sense of it and I can see it working throughout the document.
guessed; You have used .Paragraphs(2)

Are there any real advantages of using any method over another. I must admit I don't really understand how the defining of rng = doc.Range works. Are you setting the whole document as a range? I sort of like just working from where the last character was are there any pitfalls with this?
There is no inherent advantage to any of the approaches. Had I thought it necessary, I too would have defined a range object.
Quote:
Originally Posted by rpb925 View Post
2) Macropod could you please explain why you define the style (wdStyleNormal) at the beginning but do not seem to use it later?
I didn't define it; I merely set certain of its attributes. Since the Normal Style is what a new document is ordinarily based on, that's all that was needed to use it.
Quote:
Originally Posted by rpb925 View Post
3) What does turning screen updating off and on do?
It makes for faster code execution and less flickering, etc.
Quote:
Originally Posted by rpb925 View Post
4) What is the difference between saving at the start and the end?
Saving at the end saves your work; saving at the start doesn't.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote