Thursday, July 5, 2007

FW: WordTips for 14 June 2003

-----Original Message-----
From: WordTips [mailto:awyatt@dcomp.com]
Sent: Saturday, June 14, 2003 11:40 AM
To: samaruna@omantel.net.om
Subject: WordTips for 14 June 2003


WordTips for 14 June 2003 Copyright 2003 by DCI
**********************************************************************

In This Issue...
----------------
Publisher's Notes
Tips
* Modifying Behavior of the Open Dialog Box
* Automatic Blank Pages at the End of a Section
* Changing a Macro Description
* Printing a Short Selection
Help Wanted
* Controlling Check Boxes During a Merge
* Attaching Macros to Documents
Publisher and Copyright Information
Important Links
Subscription Information


Help support WordTips and obtain a valuable resource by
purchasing your own copies of the WordTips archives. Visit the
Web site (http://store.vitalnews.com/wtarch.html) for more info,
or send a blank e-mail to WordTips-CDs@lists.vitalnews.com.


**********************************************************************
PUBLISHER'S NOTES * PUBLISHER'S NOTES * PUBLISHER'S NOTES
**********************************************************************

Thanks to all those who took advantage of my birthday offer for Word
2002 Beginner's Guidebook. You helped to make mine a very happy (and
busy) birthday this year.

-Allen


**********************************************************************
TIPS * TIPS * TIPS * TIPS * TIPS * TIPS * TIPS * TIPS * TIPS
**********************************************************************
If you have an idea for a tip, send it our way. You can e-mail the
suggestion to awyatt@dcomp.com. Any tips contributed will be credited in the
issue in which they appear.


------------------------------
Modifying Behavior of the Open Dialog Box
------------------------------
Subscriber Bronwyn Robertson asked if there was a way to force the Open
dialog box to stay visible so that multiple files could be opened
consecutively. While multiple documents can be opened at the same time using
the Open dialog box, this isn't want Bronwyn wanted to do.

One solution--that only tangentially involves Word--is to use the Windows
Explorer to display the files in a folder. Open an Explorer window that
shows all the document files. You can then double-click on files, or create
a selection set of files and right-click on them and choose Open. The window
is continually available, and you don't need to worry about repeatedly
displaying the Open dialog box.

If you prefer a solution directly within Word, just remember that Word is
very configurable, which means you can change just about every aspect of the
program. This includes the behavior of the Open dialog box. All you need to
do is create a replacement for the FileOpen command, as in the following:

Public Sub FileOpen()
Dim err_handler
On Error GoTo err_handler

With Dialogs(wdDialogFileOpen)
.Name = "*.*"
Do While .Show <> 0
.Name = "*.*"
Loop
End With

Exit Sub

err_handler:
If Err.Number = 5174 Then
MsgBox "You can open only one file at a time.", vbCritical
Resume Next
Else
MsgBox Err.Number & vbCrLf & Err.Description, vbExclamation
End If
End Sub

With this macro in place, whenever you choose Open from the File menu, Word
displays the Open dialog box with All Files as the specified file type. You
can then select a file, and the dialog box again opens to await your next
selection. If you click Cancel on the dialog box, then the command ends and
you can begin your other tasks in Word.

There is a difference between this implementation of the Open dialog box and
the one that is presented normally by Word. In Word, you can create a
"selection set" within the Open dialog box so that you can open multiple
files at the same time. When you use the wdDialogFileOpen dialog box (as is
done when you create your own replacement for the Open command), you can
only select a single file at a time. This didn't seem to be a big problem
for Bronwyn, but could be a problem for other users.

If you must retain the ability to open multiple files at once, then you can
execute a commandbarcontrol. However, in executing the commandbarcontrol,
you cannot test if someone clicks Cancel.
Therefore, you need another way to get out of the loop. In the following
routine, you can select/open multiple files, but you must also respond to a
dialog box to exit the loop that shows the dialog box.

Sub GetNewFiles()
Dim Response
Do While Response <> vbNo
CommandBars("Standard").Controls("&Open...").Execute
Response = MsgBox(Prompt:="Open another file?",
Buttons:=vbYesNo)
Loop
End Sub

(Thanks to June Baker and David G. Lett for contributing to this tip.)


Got a Word-related product or service you want to let others
know about? Advertising in WordTips is a cost-effective way to let
thousands of serious Word users know about you. For more info,
visit the Web site (http://www.VitalNews.com/WordTips/), or send
a blank e-mail to WordTips-Advertising@lists.vitalnews.com.


------------------------------
Automatic Blank Pages at the End of a Section
------------------------------
Word allows you to add several types of section breaks into your document.
Two of the section break types result in the addition of blank pages to the
document, if necessary. For instance, if you use an Odd Page section break,
and the previous section ends on an odd page, then Word automatically
inserts a blank even page so that the next section can start on the next odd
page.

The problem with this is that Word inserts an absolutely blank page--it
doesn't even print headers or footers on the page. If you prefer headers and
footers or some other information on the page (such as "This page
intentionally left blank"), then you cannot rely on Word's section breaks
alone.

One approach is to manually look at a document and, if necessary, add your
own invisible text that would "print" on the page that would otherwise be
blank. You create invisible text by adding regular text and formatting it as
white. White on white, when printed, is invisible. Word, however, doesn't
realize this and provides headers and footers on the "blank" page.

An interesting approach is to create your own end-of-section standard text.
Create an AutoText entry that contains your end-of-section text, including a
page break at the beginning of the entry. Name the entry something like
"BLANKPAGE." Then, at the end of each section, just before the section
break, add the following compound field:

{ if { =int( {page} / 2 ) * 2 } = { page } " " { autotext "BLANKPAGE"
} }

Remember that the braces shown in this example are supposed to be field
braces. You enter field braces by pressing Ctrl+F9 for each set.
The field checks to see if the current page is, in this case, even. If it
is, then the field automatically inserts your AutoText information.

If desired, you can also create a macro that will step through the document,
look at each section, decide how many pages are in the section, and then add
a page break at the end of the section, if necessary. The following macro
does this very task:

Sub CheckSecLen()
Dim iSec As Integer
Dim oRng As Range
Dim iValue As Integer

With ActiveDocument
' go through each section (except for the last one)
For iSec = 1 To .Sections.Count - 1
' create a range object at the start of the section
Set oRng = .Sections(iSec).Range
oRng.Collapse wdCollapseStart
' insert a sectionpages field
.Fields.Add Range:=oRng, Type:=wdFieldSectionPages
' divide the sectionpages field by 2
' if it gives a zero as the remainder, then
' you have an even number of pages in the section,
' which is what you want with an odd section page break
If (.Sections(iSec).Range.Fields(1).Result Mod 2) <> 0 Then
' if you have an odd number of pages, then insert
' a page break before the section's section break
Set oRng = .Sections(iSec).Range
With oRng
.Collapse Direction:=wdCollapseEnd
.MoveEnd unit:=wdCharacter, Count:=-1
.InsertBreak Type:=wdPageBreak
End With
End If
' remove the sectionpages field that was added
.Sections(iSec).Range.Fields(1).Delete
Next iSec
End With
End Sub

(Thanks to Henn Sarv, David G. Lett, and Julie Venner for contributing to
this tip.)


------------------------------
Changing a Macro Description
------------------------------
When you record a macro, you have an opportunity to enter a description for
the macro. This can be helpful, as the description is a great memory-jogger
to remind you why you wrote a particular macro or how to use it.

At some point after your macro is finished, you may want to change the
description associated with a macro. To do this, follow these steps:

1. Choose Macro from the Tools menu, then choose Macros. Word
displays the Macros dialog box.
2. In the list of macros, select the macro whose description you
want to change. At the bottom of the Macros dialog box you
should see the current description for the selected macro.
3. Replace the current description with the new description.
4. Repeat steps 2 and 3 for any other macros whose descriptions you
want to change.
5. Click on Cancel to close the Macros dialog box.


------------------------------
Printing a Short Selection
------------------------------
If you have a portion of your document selected when you choose the Print
option from the File menu, Word allows you to print just that selection. The
Print dialog box will appear. To print the selection, choose Selection in
the Page Range box, and click on OK. You should note that when you print a
portion of your document in this manner, headers and footers are not
printed--only the text you select.


**********************************************************************
Step up to the PROFESSIONAL version of WordTips--WordTips Premium.
This week WordTips Premium subscribers also learned about:

* Sending Drawing Objects to the Back or Front
* Editing Wrap Points
* Inserting the Subject in Your Document
* Automatically Setting Right Leader Tabs

Each weekly newsletter is in professional PDF layout, and presents DOUBLE
THE TIPS (Premium subscribers see articles you won't in regular
WordTips) with great, useful graphics. Plus, WordTips Premium subscribers
get valuable money-saving benefits. For more information, (including a
sample issue) visit the following Web page:

http://store.vitalnews.com/premium.html


**********************************************************************
HELP WANTED * HELP WANTED * HELP WANTED * HELP WANTED
**********************************************************************
This section is for those having problems making Word behave. Having a
problem you want to see addressed? Send it to WTHelp@VitalNews.com.
Do you have an answer to the problems below? Send your answer to
WTAnswers@VitalNews.com (all responses become the sole property of DCI and
can be used in any way deemed appropriate). If your response is used in a
future issue, you will be credited for your contribution to the answer.


------------------------------
Controlling Check Boxes During a Merge
------------------------------
I have a mail merge source document that includes some form fields.
One of those fields is a check box. How can I change the condition of the
check box based on information derived during the merge? After merging, I
want some of the resulting letters to have the box checked and some to not
have it checked. (John D. Hubbard)


------------------------------
Attaching Macros to Documents
------------------------------
I am attempting to give an example of macros to a class I am teaching.
This means I have to store the macro with the demonstration word document on
a disk that I can take to the computer lab or give to a student. Writing the
macros is no problem and they work as they are supposed to when stored in
"Normal.dot." When I attach the macro to a document (instead of storing it
in Normal.dot), it will not run and I receive a message saying that the
macros have been disabled. Why does this happen, and more importantly, how
can I stop this behavior?
(Albert Thompson)


**********************************************************************
PUBLISHER and COPYRIGHT INFORMATION
**********************************************************************
WordTips (ISSN 1522-3744) is published weekly by Discovery Computing Inc.
(DCI), PO Box 2145, Mesa, AZ 85214. WordTips is a trademark of DCI.
Copyright 2003 by DCI, All Rights Reserved. All broadcast, publication, or
retransmission is strictly prohibited without prior written permission from
the publisher. Full information on distribution rights can be found in the
WordTips FAQ at the WordTips Web page.


**********************************************************************
IMPORTANT LINKS * IMPORTANT LINKS * IMPORTANT LINKS
**********************************************************************

WEB ADDRESSES
-------------
WordTips Web page -

http://www.VitalNews.com/wordtips/
WordTips Premium Web page -

http://store.VitalNews.com/premium.html
WordTips Archives -

http://store.VitalNews.com/wtarch.html
Advertising in WordTips -

http://www.VitalNews.com/advert.htm
Vital News Store -

http://store.VitalNews.com/


E-MAIL ADDRESSES
---------------
Help Wanted questions - WTHelp@VitalNews.com
WordTips sample issue - WordTips-Sample@lists.vitalnews.com
WordTips Premium info - WTPremium@VitalNews.com
WordTips Archive info - WordTips-CDs@lists.vitalnews.com
Advertising in WordTips - WordTips-Advertising@lists.vitalnews.com
Editor and Publisher - awyatt@dcomp.com


**********************************************************************
SUBSCRIPTION INFORMATION * SUBSCRIPTION INFORMATION
**********************************************************************
TO RECEIVE WordTips regularly via e-mail at no charge, send an e-mail to <
join-wordtips@lists.vitalnews.com >.

You are currently subscribed to wordtips as: [samaruna@omantel.net.om] To
unsubscribe, forward this message to
leave-wordtips-296702L@lists.vitalnews.com

No comments:

Business Line - Markets