RE: Copy/paste table formatting in Word?

Subject: RE: Copy/paste table formatting in Word?
From: "Janoff, Steven" <Steven -dot- Janoff -at- ga -dot- com>
To: "techwr-l -at- lists -dot- techwr-l -dot- com" <techwr-l -at- lists -dot- techwr-l -dot- com>, Tony Chung <tonyc -at- tonychung -dot- ca>, "Gilbert, Brian" <BGILBER -at- transunion -dot- com>
Date: Wed, 3 Apr 2013 15:10:24 -0700

Thank you, Brian and Tony! (And Jessica, behind the scenes.)

I am about to become schooled in the use of macros! :)

Steve

From: Tony Chung [mailto:tonyc -at- tonychung -dot- ca]
Sent: Wednesday, April 03, 2013 2:43 PM
To: Gilbert, Brian
Cc: Janoff, Steven; techwr-l -at- lists -dot- techwr-l -dot- com
Subject: Re: Copy/paste table formatting in Word?

"Janoff, Steven" <Steven -dot- Janoff -at- ga -dot- com>
Is there a quick way to copy/paste table formatting in Word 2010 (Windows 7)?


"Gilbert, Brian" <BGILBER -at- transunion -dot- com>
Use a macro. Go to the table. Start the macro.


I like Brian's macro idea so much. I wrote one. To add this macro to your document (or your Normal.dotm, preferred):
1. In Word, press ALT + F11 to open the VBA editor.
2. Right click Normal and select Insert > Module
3. Copy and paste this text into the window:
' Code snippet -- BEGIN
Sub TableSetup()
    Dim tblTable As Table, iCount As Integer
    For Each tblTable In ActiveDocument.Tables
        With tblTable
            .PreferredWidthType = wdPreferredWidthPercent
            .PreferredWidth = 100
            .Columns.PreferredWidthType = wdPreferredWidthPercent
            .Columns(1).PreferredWidth = 17
            .Columns(2).PreferredWidth = 83
            .Rows(1).HeadingFormat = True
        End With
        iCount = iCount + 1
    Next
MsgBox iCount & " tables updated"
End Sub
' Code snippet -- END

4. Open the document where the tables need to be adjusted.
5. With this document highlighted, press ALT + F8 to open the Macros dialog.
6. Select TableSetup and press Run. All the tables will be set the same.
You can add other properties to this macro to automate even more things. I love VBA.
-Tony

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>From our sponsor Doc-to-Help: Want to see a Doc-To-Help web-based Help sample with DISQUS for user commenting?

Learn more: http://bit.ly/13xpg5n

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-

To unsubscribe send a blank email to
techwr-l-leave -at- lists -dot- techwr-l -dot- com


Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit
http://www.techwhirl.com/email-discussion-groups/ for more resources and info.

Looking for articles on Technical Communications? Head over to our online magazine at http://techwhirl.com

Looking for the archived Techwr-l email discussions? Search our public email archives @ http://techwr-l.com/archives


References:
Copy/paste table formatting in Word?: From: Janoff, Steven
RE: Copy/paste table formatting in Word?: From: Gilbert, Brian
Re: Copy/paste table formatting in Word?: From: Tony Chung

Previous by Author: Copy/paste table formatting in Word?
Next by Author: Word: Compare Acronym table to external master
Previous by Thread: Re: Copy/paste table formatting in Word?
Next by Thread: Re: Copy/paste table formatting in Word?


What this post helpful? Share it with friends and colleagues:


Sponsored Ads