View Full Version : help with creating word macro
Chetanh
03-13-2008, 08:08 AM
Hi,
I have a word template that users click on to create documents. The template has a predefined set of headers, footers, tables and fonts. The margins are set to 1 inch on the left and 2 inches on the right.
Is there some macro/ VBA code i can put into the document such that when the document extends to the seconds page the size of the right marign changes automatically from 2 inches to 1 inch.
thanks
fumei
03-13-2008, 09:17 AM
Margins are tied to Sections. If there is no Section break, then the second page will have the same margins as the first page. The issue is:
"when the document extends to the seconds page "
Extends how? Just by putting content in? If so, then the answer is no, not unless you use some way to determine that it has made a second page, and then go BACK and put in a Section break.
mdmackillop
03-18-2008, 06:54 AM
The simple workaround for this is to draw a rectangle where you want the border in the First Page header, format the shape border to No Line so that it is invisible, and Layout to Tight as per this example.
fumei
03-19-2008, 11:49 AM
VERY cute Malcolm. I will add that one to my store of interesting tricks. I have never thought of doing that for margin purposes. I have learned something. Good one.
mdmackillop
03-19-2008, 03:24 PM
Hi Gerry,
I wish I could take credit, but I think it came from a MVP website. We use headed paper with a band down the right side, so this method is used on all our letter templates.
Alphacsulb
03-20-2008, 02:49 PM
Ive used that MVP site numorous times, works well.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.