![]() |
#1
|
|||
|
|||
![]()
I have a number of different formats I use in my work with Word. Different pages sizes being the main one, but then different margin sizes, font sizes, table settings etc within those page sizes.
My question is would it be possible to create a series of macros that, with the click of a button, I change a document into those varying formats and their specific requirements within? |
#2
|
|||
|
|||
![]()
Yes. But if the format doesn't change during the life of a document you'd be much better just setting up a series of templates.
If you need to completely alter the formatting of a document depending on where it is going then macros may be a solution. |
#3
|
|||
|
|||
![]()
I have to transfer the contents from a particular program to Word and when I do the original formatting remains, even though I already have certain specifications like font type, font size, margins and indentations etc. set up. So what would be amazing is to be able to click a button and have it all reformatted as I need.
|
#4
|
|||
|
|||
![]()
Then the answer is that a suite of macros is probably the best option. Good luck. I've spent the last 9 months doing something similar. It can be a big job. Working with styles in VBA can be an enormously frustrating exercise.
|
#5
|
||||
|
||||
![]()
Here's some basic code to do an A4 setup.
Code:
Sub A4Format() Application.ScreenUpdating = False With ActiveDocument With .Range.PageSetup .BookFoldPrinting = False .BookFoldRevPrinting = False .PaperSize = wdPaperA4 .TopMargin = CentimetersToPoints(2.5) .BottomMargin = CentimetersToPoints(2.5) .LeftMargin = CentimetersToPoints(2.5) .RightMargin = CentimetersToPoints(2.5) .MirrorMargins = False End With End With Application.ScreenUpdating = True End Sub As for fonts, indents, etc., if the source documents have used Styles consistently, that part of the job is simply a matter of changing the Style definitions; otherwise it's a case of iterating through the paragraphs and updating them individually (perhaps even applying Styles to ensure conformity to corporate standards and simplify future updates).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
KeviM | Word VBA | 1 | 04-07-2017 05:36 PM |
Create a dynamic document (Specifications on RFP) | HOPAL | Word | 1 | 04-05-2017 11:19 AM |
Single step Word Styles from Source Document through entire Destination document? | xbliss | Word | 6 | 08-27-2016 09:36 PM |
![]() |
laurieli | Office | 7 | 01-17-2016 08:56 AM |
How to automatically enable macros upon opening the Word? | laurieli | Word VBA | 2 | 12-22-2015 02:46 PM |