P
Patricia Shannon
I am reviewing houndreds of documents. I have a macro that closes the current
document and opens the next document in the same folder. For .txt files, I
want to retain formatting once I've set it to make it easier to review the
document.
I was able to do so with page orientation, page margins, and font type.
However, when I set font size to 9, it usually stays there for a few times
thru the macro, then goes to 9999999, which sometimes then reverts to 10.
So I have hard-coded the font size.
I put a bunch of "debug.print"s in the macro, and the place where the font
size changes seems to be fairly random. In fact, sometimes I have seen the
following situation (with relevant parts of the code):
Dim HoldRange As Range
....
With ActiveDocument
Set HoldRange = Selection.Range
HoldRange.WholeStory
....
HoldRange.Font.Size = 9
Debug.Print "Final font size ="; HoldRange.Font.Size
The Debug.print shows the print size as 9999999
even though the immediately preceding statement set it to 9 !
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/communitie...34848e59&dg=microsoft.public.word.vba.general
document and opens the next document in the same folder. For .txt files, I
want to retain formatting once I've set it to make it easier to review the
document.
I was able to do so with page orientation, page margins, and font type.
However, when I set font size to 9, it usually stays there for a few times
thru the macro, then goes to 9999999, which sometimes then reverts to 10.
So I have hard-coded the font size.
I put a bunch of "debug.print"s in the macro, and the place where the font
size changes seems to be fairly random. In fact, sometimes I have seen the
following situation (with relevant parts of the code):
Dim HoldRange As Range
....
With ActiveDocument
Set HoldRange = Selection.Range
HoldRange.WholeStory
....
HoldRange.Font.Size = 9
Debug.Print "Final font size ="; HoldRange.Font.Size
The Debug.print shows the print size as 9999999
even though the immediately preceding statement set it to 9 !
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/communitie...34848e59&dg=microsoft.public.word.vba.general