Microsoft Word

27K

Solutions

20K

Contributors

Microsoft Word is a commercial document editing program that is part of the Microsoft Office suite. It features numerous text-editing tools for creating richly formatted documents, along with tools for the use of macros in Word documents. Word's native file formats are denoted either by a .doc or .docx file extension. Plugins permitting the Windows versions of Word to read and write formats it does not natively support, such as the OpenDocument format (ODF) are available. Word can import and display images in common bitmap formats such as JPG and GIF. It can also be used to create and display simple line-art.

Share tech news, updates, or what's on your mind.

Sign up to Post

Dynamic Printer Selection
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with the Access and Word Printers collections.
0
[Webinar] Learn How Hackers Steal Your Credentials
LVL 9
[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Fonts
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how to install downloaded fonts.
5
 
LVL 24

Expert Comment

by:Brian B
Comment Utility
That is a really useful article, Andrew. Thanks for sharing.

A question though, back in the "old days" by my standards, you weren't supposed to share fonts because many of them were sold separately and were considered to be under the software license of the product they worked with. I would assume if you can get the font from Google that it is safe, but are there still instances of those IP fonts today that aren't supposed to be shared?
0
 
LVL 11

Author Comment

by:Andrew Leniart
Comment Utility
Hi Brian,

An excellent observation. With regards to safety of available fonts, I can only assume that all submissions are checked by Google in this respect before a listing is accepted, so while never beyond the realms of possibility, am confident that a malicious font download is unlikely.

I'm sure there are many fonts to be found on the web which are not supposed to be shared as you've rightly pointed out, however with every font downloaded from the Google Fonts site, there is also a license agreement included within the downloaded Zip file that specifies which usage license the font has been released under.

In the case of the illustrated "Lato" font used in my example, that particular font has been released under the Sil Open Font License (OFL) and comes with the following conditions when downloaded.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions,
The list of exclusions are as one would expect for most open source material, such as preventing the sale of the font by itself etc, however for personal or commercial use within other products, there's no problem.  This could differ of course with each font that's made available so it always pays to check what rights are provided. Font families not available on Google Fonts and found on other font distribution sites would of course contain their own rules and restrictions, which should always be respected.

I hope that answers your questions and thank you for your feedback and up-vote. I very much appreciate it. Regards, Andrew
1
Merge to Word
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and installed automatically, for .mdb and .accdb databases.
0
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents. The steps to find the Templates folder path are given for Office versions from 2003 through 2016.
0
 
LVL 31

Author Comment

by:Helen Feddema
Comment Utility
I will see if I can get that information.
1
 
LVL 31

Author Comment

by:Helen Feddema
Comment Utility
David -- this is most curious.  For Access 2010, the location for database templates is C:\Program Files\Microsoft Office\Templates\1033\Access.  But for Access 2016, it is C:\Program Files (x86)\Microsoft Office\root\Templates\1033\Access\Part.  I have 64-bit Office and Windows, in case that makes a difference (it probably does).
0
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
10
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
Out of curiosity, how did you even come to the initial correlation of checking video hardware acceleration?
I can't speak for the author, but that's an old bugaboo from circa 2000.
Compaq Presarios would GPF under Simply Accounting if Hardware Acceleration was left turned on.
Now, why an accounting program or a word processor should screw up if a setting that should rightfully apply to gaming is turned on, your guess is as good as mine -- but while that was the first, I doubt it will be the last.

Now that this has come back to mind, I have one triple monitor system with Simply Accounting that has some lag in rendering.  I'll have to go try the old fix -- nothing else has worked!
0
 
LVL 14

Author Comment

by:Joseph Hornsey
Comment Utility
Nick67 is right... I ran into problems with hardware acceleration a long, long time ago in Windows NT 4.0 and Windows 2000.  I still didn't make the connection until I started going through all the settings in Word and saw this particular one.

Quite frankly, I only messed with it out of sheer desperation.  I mean, two overclocked NVIDIA GeForce GTX 780's with SLI can't handle Microsoft Word?  LOL
0
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.
 

What is Send to Mail Recipient?


Send to Mail Recipient is a command available in Microsoft® Word that lets you send the body of a document as an email message rather attaching the file to an email. Microsoft Outlook® should be your default email client.
 

Why Use Send to Mail Recipient?


The Send to Mail Recipient command is useful when–
 
  • you draft email that requires the formatting and editing controls available in Word.
  • you have to send a standard email to a distribution list on a regular basis (e.g.,payroll notification, fiscal year-end notification, project milestone updates) and have to re-create the email each time; or
  • you have templates for company email that you want to share with your team or department. You can create templates in Outlook® but many people find Outlook®'s Design a Form interface difficult to use. Word is accessible to a greater number of users.

The advantages of using this tool are:
 
  • use of Word formatting and editing tools;
  • ability to organize the original Word files and save them to a shared server location or a SharePoint® site for centralized access by your team members;
  • ability to easily create and share the Word files as templates; and
7
 

Expert Comment

by:Member_2_7967349
Comment Utility
I'm having a problem using this feature:
When I click Send to Mail Recipient, I then change the From option to shared mailbox.
This adds some extra lines into the body of the email - when i go to "undo" the change, it says Undo Replace Email signature.  If I click this, Word crashes.
This is reproducible - do you have any advice?
Many thanks!
Ruth
0
 
LVL 5

Author Comment

by:C. Blaise Mitsutama
Comment Utility
Ruth,

I sent you a direct message response to your question because I had been off E-E for several months. I rejoined to reply to you, but there was a technical issue that prevented my commenting on this article.

I'm adding this comment so that others can see my reply.

Since I have never used "Send to Mail Recipient" with a shared mailbox, I haven't experienced the problem you describe. However, shared mailboxes cannot have separate (autonomous) accounts in Office 365, and it may be that "Send to Mail Recipient" is checking for an individual email account for the sender. When it encounters the non-conforming shared mailbox, it breaks.

So far, I haven't found a KB article or other documentation of this issue, but it's going on my "to be researched" list.

Blaise
0
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) work for you is extremely simple, and can save you lots of time in the long run.
 

What is the Ribbon?

The ribbon is the top expanded toolbar visible in your Word document. 
Ribbon01.PNG
Keep in mind customizing the ribbon is specific to Microsoft Word and changes will not be applied across other Microsoft Office programs. The customization also has its limits, you can’t rename, change the icons, or order of the default commands (it will become clear what you can and can’t change).

The ribbon is different than the quick access toolbar, which can also be customized (more on that later) and shown below or above the ribbon. This toolbar only shows icons for various actions, and can be helpful for even faster access to your most commonly used tools.
Ribbon02a.PNG

Start Customizing your Ribbon

It's very easy to get going in customizing the tools you see on your ribbon and various tabs. 

Right click on the Ribbon > Customize the Ribbon 
(This is also where you can show the quick access toolbar)
Ribbon02.pngThis window will pop-up, allowing you to apply changes to your ribbon.

Ribbon03a.PNGFrom here you can customize both your ribbon and quick access toolbar by selecting from a lengthy list of Word's commands and adding/removing them from your ribbon. 

9

Preface:

When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and removed the user interface for creating commandbars. This resulted in a common misconception that all CommandBars have been deprecated (eliminated). The truth is that you can no longer create CommandBar MENUS starting with Office 2007. However, you can still create and use pop-up menus, which are sometimes referred to as "right-click" or "shortcut" menus, using VBA. This series is all about these types of menus; I will use these two terms interchangeably in the remainder of this article.
 

Introduction:

Part 1 of this series (Understanding and Using Commandbars) describes techniques for exploring and using the CommandBar object. Part 2 of the series (Creating your Own) provides a more detailed discussion of the CommandBar and CommandBar Control object models, and demonstrates how to create your own shortcut menus.

While working on a new application, I found a need to not only develop my own right-click menus, but to augment and replace several of the …
4
 
LVL 48

Author Comment

by:Dale Fye
Comment Utility
Thanks.  This is the first article I've written using the new editor, and I like the flexibility.  I was a little disappointed in the ability to size text other than using the couple of "styles".
0
 
LVL 66

Expert Comment

by:Jim Horn
Comment Utility
Excellent article.  Voted Yes.
0
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used. 

One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to get a result it can be difficult for those of us who are relatively new to programming (and self taught) to figure out where the inefficiencies lie.  So I thought I would share this in the hope it helps someone. 

My problem was not timing code as such; there are some excellent articles covering that -- for example this by Martin Liss. What was not obvious to me was how to keep track of timing more than one block of code at a time. For example I have a procedure that calls other procedures; how do I find out which is taking the longest to run?
 
Sub myTest()
Dim i As Long
' ====================
' some code here
For i = 1 To 10000000
Next i
' ====================
Call ExternalSub1
Call ExternalSub2
' ====================
' some code here
For i = 1 To 10000000
Next i
' ====================
End Sub


Sub ExternalSub1()
Dim i As Long
' ====================
' some code here
For i = 1 To 5000000
Next i
' ====================
End Sub

Sub ExternalSub2()
Dim i As Long
' ====================
' some code here
For i = 1 To 20000000
Next i
' ====================
End Sub

Open in new window

One solution that was more than …
1
 
LVL 46

Expert Comment

by:aikimark
Comment Utility
I you are only going down to the resolution of the GetTickCount() API, you could use the VB Timer function and multiply it by 100.

I have packaged the QueryPerformancecounter API into a class that allows me to start/stop each counter as required.  I have performance measure resolutions down to the single statement.

For i = 1 To 10000000
Next i

Open in new window

Be aware that the compiler does optimizations.  When you want to get a baseline for a loop, don't time an empty loop.  Make it do some lightweight operation, such as XOR applied to a byte or integer variable.
0
 
LVL 15

Author Comment

by:DrTribos
Comment Utility
Thanks aikimark - nice tip :-)
0
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case function just scroll down until you see the big dots.

In VBA (and most other programming languages) it is common to find collections of items enumerated.  For example MS word uses enumeration for all manner of things including paragraph formatting line spacing rules:
Intellisense - for line spacing ruleThe thing is, although you select words, these are actually numbers...
Words resolve to numbers...The image above shows that VBA prefers to spit out a number when you interrogate an enumerate item.  The same applies for colors, shapes, built-in dialogues, and pretty much anything else you can think of.  Searching Enumeration in the VBA Help yields a ~20 page list of collections of enumerated items, about 500 documented collections.

I was in the unfortunate position where I had standard (i.e. built in) ‘enum’ values stored as strings but was unable to use them because MS Word was expecting a number. The following code, for example, does NOT work:
Dim strLSR as String
strLSR = "wdLineSpaceMultiple"
With ActiveDocument.Styles("myStyle")
     .ParagraphFormat.LineSpacingRule = strLSR
End With

Open in new window

It produces a type mismatch error.  

I guess the error message was trying to tell me that a "string" <> "integer"...  In essence it seem the …
0
 
LVL 15

Author Comment

by:DrTribos
Comment Utility
@aikimark,

Thanks for the followup. I'm very much looking forward to reading your articles... I wish someone had told me all that about a year ago (on reflection they might have but I didn't understand).  

I have also used INI files but only to grab single items of information.  However now, where I need the flexibility you mention, I am moving to XML and find it satisfactorially fast.

I still think select case has a place in code, at least as much as an if statement, but certainly agree that depending on the task other approaches may be more appropriate.

In the meanwhile I hope the article serves to help other learners understand what select case is, how it can be used, and provides some insight into programming as they "learn to walk, before they run".  

The thing that occurred to me was that here I am performing a repetitive (programming) task so that I did not have to perform a repetitive (documenting) task... so I had a crack (1st attempt) at automating the programming process...
0
 
LVL 46

Expert Comment

by:aikimark
Comment Utility
Here is a link to my (just published) article:
http:/A_14015-Iterating-Office-Enumeration-Constants.html
0
Enroll in July's Course of the Month
LVL 9
Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Shortcuts in Word

Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortcuts was impossible and only then did I realize that using keyboard shortcuts has become sort of a second nature to me and using them did save me a lot of time.
But I'm writing this for those who maybe know Ctrl+C, Ctrl+V, Ctrl+F, Ctrl+H… but still wonder what else is out there. Who best to answer that then Word Itself? You can ask Word for a list of all shortcuts you can use and he will even give you an option to go with only those that are supported by your current keyboard settings. This is how…
No matter what document is opened, the command will create a list of commands in a new document so you go to View and choose Macros or View Macros from the drop-down. You get
 MacrosUnder Macros In: you choose Word Commands and you get a full list of commands in the above box. There you Search for the List Commands »macro«. And you choose Run.
 Word CommandsWord only asks you one more thing. Do you want the commands that go with the current keyboard settings (which is default and is what you want since those are the commands you can use) or do you want All Word commands (not all will work). You click OK and voila, you get a new document listing the shortcuts you can use. Great bedtime reading material :)
 Dialog Box

Random text in MS Word

1
I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc.

First question could be what is this feature good for? Mailing can really help you and save a lot of time when you are working with some database and data from this database has to be placed in some document. In this way you can create, let say, rule how and which data will be used.

Because I really like to explain on examples from real word, not a theory, I do it also now. There is a database of customers I want to wish Merry Christmas and Happy New Year, because they are top customers. I will send them a letter, but I do not like to write Dear Sir/Madame, I want to be more personal so I will write their names. This I can do manually – copy/paste – what could be good way, but not in case I have 100 customers like that, or 1000 (if I am a big company), so there is a place for Mailing.

So what I need to do, basically 2 things:
•      Write a letter
•      Database (e.g. in excel)

Word text

I will write the letter as normally I do, except words which won't be "static", in this case name and surname will be such a dynamic words. See sample:
 
01
As you can see there is a part of letter where company is sending to customer, but there is missing name and surname next to "Dear". These 2 words will be added from database and will be changed dynamically.

Database
1

Introduction

This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided.
The benefits of using these tools means your documents are more accessible and easily portable to other applications and formats.

Where to start?

I always recommend the best way to write a document in Word is simply  content and ignore the urge to style the document until you have entered all the content and are ready to format. I understand that some people find it hard to work this way as the document appears to lack structure and makes it difficult to know where you are. In that case I recommend you begin your document by typing out all the headings before adding any content; this gives the document structure and will also help you plan your document.
Using this method, type in your headings such as ‘Introduction’, ‘Requirements’, ‘Conclusion’ etc and convert each one to Heading 1 by putting the cursor anywhere in the word and pressing the key combination Ctrl+Alt+1.
If you wish to add sub headings to each section repeat the process but this time the key combination will be Ctrl+Alt+2.

Paragraphs and spacing and page breaks

When you’re ready to start adding the body text, simply type the way you would if you were using a Word processor (if you’re old enough to know what that is). What I mean by this is resist the urge to do anything more than type and then press ‘enter’ at the end of each paragraph. I find a …
10
 
LVL 21

Expert Comment

by:Eric Fletcher
Comment Utility
Good points PortlettPaul. I think many users would be far better off sticking to something simple like Wordpad to prepare their documents. With all its features, Word is overkill for straightforward letters and basic documents.

That being said, Word's features do make it possible to prepare a well-structured document with functional elements such as tables of contents, indices and page headers.

In almost all cases of a book being published in the pre-1975 era, designers, proofreaders and editors were key parts of the process -- and only specialists set the type. New tools -- like Word, but also more advanced layout applications like InDesign -- make it possible to do the layout part more efficiently and with more options. However, it also means that anyone able to run the SW can use it to "produce" a book: sometimes it works; often it doesn't.

Whenever possible, I strive to have clients agree to paying for a designer to spend some time up front to set up a minimal set of rules for the layout, and then work through a style guide (as in grammar, spelling, editing, etc. versus formatting styles). The results can be used for more than a single book, and if done properly, can be part of how an organization presents itself more widely in print.

I can then work with the layout design and style guide to come up with appropriate template(s) for production.  This certainly includes Word styles, but also may include custom tools like macros or autotext.

My objective is to make it easy for keyboard operator(s) to keep their focus on the content, so for most jobs I use a pretty generic template with standard styles aimed at formatting for editorial and proofreading efficiency. This means a simple layout, with minimal pagination features but well-planned styles so the operator can get presentable content without getting bogged down in the complexities of document structures.

When it comes time to prepare the final layout, a different template -- using the same named styles, but now with the designer's specs -- can be attached and a layout specialist can go through and implement the document structural elements.

In my experience, without this sort of approach occasional users of Word (and similar programs) end up spending far more time fussing with things they don't understand, at the expense of tasks they can do well. If I am being paid to produce a scientific publication, I want to make it easy for the researchers to focus on their specialties (i.e. the content) and leave the layout to other specialists.

That, in a nutshell, is why I am such a fan of Word's styles and templates for formatting documents!
0
 
LVL 40

Expert Comment

by:Vadim Rapp
Comment Utility
PortletPaul, if the goal is content, then Word shouldn't be in the picture at all. There's Notepad. Yes, whenever I need to create a note, I open Notepad. It's even in my QuickLaunch toolbar. Word is only when I actually need Word.

Same as when you send plain email, plain text format is sufficient - which means that plain text should be the default, and you switch to HTML only when you actually want to make something fancy. So the end result is not your 2 sentences plus 50 kilobytes of CSS. True aesthetics should be not only on the visible surface.

"Keep it simple" means also choosing the minimally sufficient tool for the purpose. But once chosen, you have to be on the level with it. If you need to drive to the supermarket, you take your old Toyota and in the parking lot you park near the garbage bin, it's OK. If however you took your Lexus, then you have to be on the level, and you'll have to find another place to park, and even use and tip the valet - otherwise it's disrespect to Lexus. Word is about the same.
0
Nice table. Huge mess.

Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to table results in hundreds of columns or hundreds of rows (depending on the separator you choose). The fastest way to clean this up? Search and destroy.

If you aren’t sure what I’m talking about, click the Show/Hide ¶ to see all those lovely spaces: Word Table made with spacebar

1. Tabs

Begin by setting up tabs. If you can’t see the ruler and tab button…
a.      Word 2007/2010 – Click the View Tab and check the Ruler checkbox in the Show Group.
b.      Word 2003 – On the View Menu, select Ruler.

2.

At the left edge of the window, above the Vertical Ruler, you’ll see a button, probably showing what looks like a capital L. It’s actually the Left Tab button. Clicking this button repeatedly will toggle it to Centered, Right, Decimal, and Line tabs. In Word 2007/2010, it also toggles to set the indents. For now, we’re just going to use the Left Tab.

3.

Select all the text in your messy table. BTW, if you move into the left margin area of your page, your mouse becomes an arrow that points NorthEast, toward 1:00 on a clockface, you get the idea. Click and drag straight down to select all the text to the right of the mouse arrow.

4.

Click on the Ruler to set your tabs, roughly …
1
 
LVL 21

Expert Comment

by:Eric Fletcher
Comment Utility
Uh, well did you try repeating my sample? Your procedure doesn't work for the reasons I've identified.

I think most EE readers find the full threads of article quite useful, so I added my comment because I could see a potential flaw. I intended it only as a constructive critique. Your procedure will work for some tables, but not all -- and if it failed for an EE reader of your article, my comment might help them figure out why.

I take your point about some users not being comfortable with Excel. However, it is a valid alternative method that could be more appropriate for users with extensive tables and a knowledge of Excel. I don't think mentioning it takes away from your article at all.
0
 
LVL 9

Author Comment

by:Colleen Kayter
Comment Utility
Actually, Eric, I've used your method for replacing hard line endings. There's another article written by me using that. Came in very handy when converting 20 offices from WerdPurfekt to Word.
0
This works in all versions of Word.

FIRST SCENARIO: You open a document from long ago or far away only to discover there are hard returns (¶) at the end of lines within paragraphs and two or more ¶ between paragraphs. Time for global search and destroy.

Begin by replacing that Times New Roman font, if you like. Do this first so that when you replace manually formatted headings with styles, you won't overwrite the style font.

This one is easy. CTRL+A to select all text. Select your preferred font for body text. You could use the body text style, but that will make it more difficult to identify headings.

1. Temporarily replace double ¶ with a different symbol. Find and replace ¶¶ with @@@. In the find field, type "^p^p" (without quotes). In replace field, type "@@@". Replace all.

2. Find and replace single ¶ with spaces. In the find field, type "^p" and in the replace field, type a space. Replace all.

3. Now you can restore the ¶ you need. Find and replace "@@@" with "^p". Replace all.

4. CTRL+A to select entire document. CTRL+0 to add a single line of space before paragraphs.

Now it's time to replace manual heading formatting with styles.

1. Click in a heading to see what font size is used. If there are also subheadings, check out the size for those also.

2. Open find and replace dialog box and click the MORE button.

3. Click the FORMAT button, then the FONT... option. Enter the font size you want to replace with Heading 1 style. Click OK.

5
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Voted "Yes" above.
0
 
LVL 38

Expert Comment

by:younghv
Comment Utility
I would really like to see more EE Articles like this one.
After using MS Office for many years, it is still amazing to find out these tricks & tips.

Thank you for writing it.
"Yes" vote above.
0
This article has been written to give the reader a starting point from which to make accessible Word documents. It is aimed at people who have used Word long enough to have developed bad habits such as manually creating headers instead of using the built in styles or specifying them.

What is Accessibility?


I found the following definition on Wikipedia which seems to fit the bill:

Accessibility is a general term used to describe the degree to which a product, device, service, or environment is available to as many people as possible.

In the case of your Word document the idea is to make it available to as many people as possible. This article will address the needs of people with visual impairments or complete blindness. People with visual impairments rely on the use of software and hardware to navigate through your document so what we need are markers and structure to aid the devices they use such as screen reading software.

Formatting


Yes it's that simple; just by making sure you format your document correctly you are well on your way to creating an accessible document. When I say "formatting" I do not simply mean selecting some text, making it bold and increasing the size to 16 points. I mean selecting the text and using Word's inbuilt styles like Heading 1, Heading 2, etc. which you will find on the home ribbon toolbar in Word 2007 onwards or in the taskpane if, like …
3
 
LVL 21

Expert Comment

by:Eric Fletcher
Comment Utility
Good points. I'd just like to point out that since you are advocating the use of the built-in heading styles, using the Outline view (and its associated tools) is probably an easier way to create and manage the structure of a document than creating a table of contents.

In outline view, you can drag and drop headings to move them (with their subheadings and any associated body copy) and demote or promote levels at any time.

The default table of contents also uses the built-in Heading styles, so it can always reflect the outline view structure.
0
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing.

A Range property can define any part of a Word document, so has beginning and an end, which are simply character counts. Not all ranges are in the body of the document. There are separate sets of ranges (called Stories) for other parts such as headers, footers, comments, etc, which won't show in the body range.

The advantages of using a Range object in your code are several.

It is faster, because it doesn't necessarily have to wait for the screen to catch up. Screen flicker is also minimised.

The user's selection will remain unchanged (or close to the point if its range gets deleted).

You can have as many ranges as you like in your code, while there is only one Selection object. For instance you can deal in the code with several documents, without having to make each one active when you want to work on it.

You can keep track of the text and change the formatting after changing it:
MyRange.Text = “Some text”
MyRange.Font.Bold = True

Open in new window


Not altogether a specific the Selection object problem but you may notice that recorded macros are very long. This is because all the defaults are coded as if you specifically wanted to set them to the default. However in Find recordings, you will notice a ClearFormatting. It is only …
5
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
GrahamSkan,

Nice article - voted 'Yes' above.
0
I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my learning curve, I understand.

What I now realise, is when I read Mr. Robbins instructions, I mostly didn't recognize the significance of many of the points he made.  Mr. Robbins was very clear, but I wasn't.  I hope this helps you avoid my blindness.

Oh, and for the record, I used this tool with Microsoft Word 2010.  So I can assure you it works with that version, too.

First, do pay attention to Mr. Robbins statement that you must "set a reference to the Microsoft Office Outlook Object Library."  You find that is by opening any macro from within Word, and then do what Mr. Robbins says regarding the "Reference" menu.  

My other point is do not confuse "Microsoft Office Outlook ##.0 Object Library" with the other items that can look like the one you want.  

Also, in Word 2010, the item you need is slightly different that what's listed in the Mr. Robbins instructions:

You want:
"Microsoft Outlook ##.0 Object Library" instead of
"Microsoft Office Outlook ##.0 Object Library."  

Notice the word "Office" isn't in the Word 2010 version.

Because I didn't notice that difference, and because I wasn't reading carefully, I spent a half-hour feeling lost because I'd thought I had …
2
 

Expert Comment

by:Fernando Trigo
Comment Utility
Hello, nice tips! :-)

do you know if it works on word 2016?

thanks
fernando
0
It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text cannot be used by simply be copying and pasting into another Word document. Each field must be inserted individually.

Sometimes there can be a complex structure of nested fields, in which case the task can be quite tricky. Here is a relatively simple example from a recent question.

{ IF {Mergefield creditors) > 300 "Employee 1
Employee 2
Employee 3" "{IF {Mergefield creditors} > 200 "Employee 1
Employee 2" "Employee 1" }" }


This macro set converts such text into the fields that it tries to portray. There is no error checking, so the text would have to be well-formed.  
 
Sub CallTextToFields()
    Dim rng As Range
    Set rng = Selection.Range
    TextToFields rng
End Sub

Sub TextToFields(rng1 As Range)
    Dim rng As Range
    Dim fld As Field
    
    Set rng = GetField(rng1)
    Do Until rng Is Nothing
        rng.Characters.First.Delete 'remove the "{"
        rng.Characters.Last.Delete 'and the '}'
        rng.Copy
        Set fld = ActiveDocument.Fields.Add(rng, wdFieldEmpty, rng.Text, False)
        fld.Code.Paste 'VBA bug. The line above corrupts nested fields, so we replace the range
        Set rng = GetField(rng1)
    Loop
End Sub

Function GetField(rng As Range) As Range
    Dim rngStart As Long
   

Open in new window

4
 
LVL 76

Author Comment

by:GrahamSkan
Comment Utility
Thank you teylyn.

You did nothing wrong, and it's not the Word version.

I seem to have pasted test versions in at some time. I have now replaced them with newer versions.
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Comment Utility
Wow! Very neat.

Thank you !!!
0
On Demand Webinar: Networking for the Cloud Era
LVL 9
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon.

In Word 2007/2010, one of the things that I find missing when using styles is a quick way to identify the style of a given paragraph. The emphasis is on "quick". The "slow" methods include:

Find the style highlight in the visible style buttons on the ribbon. Chances are that you'll have to click the drop-down arrow to display the complete style gallery to see the highlight. But some styles won't even show up here in the first place (like the TOC styles that determine the look and feel of each individual TOC level.
Open the Styles pane, which will be a little window that hovers in the document window. You can configure which styles show up in it, but depending on how many styles it shows, you will need to scroll to find the style highlight for the currently selected style.
Both these options I find unacceptable, because they involve too many clicks to get me where I want to be. I found a very "quick" way to identify the style by adding a command to the Quick Access Toolbar (QAT).

How to add the Style command to the QAT

1

Click the "Customize Quick Access Toolbar" icon and select "More Commands" to edit the QAT.

2

In the list of commands, select "All Commands".

3

Scroll down to the Style command. Note that there are quite a few …
8
 
LVL 60

Expert Comment

by:Kevin Cross
Comment Utility
teylyn,

I have to agree with Patrick. You definitely have my Yes vote above. Thank you for taking the time to contribute this. It will come in very handy in my current Word 2007 and will be added to my checklist for Word 2010 install.

Kevin
0
 
LVL 70

Expert Comment

by:Qlemo
Comment Utility
Extremely useful! That teaches me to watch more for that small little icons behind the available QAT commands, because MS did a bad job hiding those text fields from everything ...
0
Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look no further! I will show you a small trick in Microsoft Word (2007 and above) to create a large test document with random text in less than 5 seconds, and then you can impress your colleague or your boss with this little secret trick.

Insert Lorem Ipsum Text:

1. Launch Microsoft Word 2007 (or above)
2. Type in "=lorem(m, n)", substituting m and n with numbers in a new line. For example, "=lorem(50,35)"
3. Press Enter key

Vola, Microsoft Word automatically inserts random "lorem Ipsum" text in your document. The meaning of the parameters in the lorem() function is:
m: the number of paragraphs created
n: the number of setences in each paragraph
So the above example will insert 50 paragraphs of "lorem Ipsum" text with 35 sentences in each paragraph.

Insert Random Readable Text

1. Launch Microsoft Word 2007 (or above)
2. Type in "=rand(m, n)", substituting m and n with numbers in a new line. For example, "=rand(30,25)"
3. Press Enter key

Microsoft Word automatically inserts random readable text in the document. The parameters in "rand()" function have the same meaning as in "lorem()" function, so …
14
 
LVL 9

Expert Comment

by:Trenton Knew
Comment Utility
neat!
0

Introduction



Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other than a web browser, go through successive drafts, and then paste the resulting text into the web browser at the end.

Indeed, I typically use this approach in writing my own articles, stopping occasionally to paste in the current state of the draft into the EE article submission editor to take advantage of the preview function.

Originally I used Notepad, the ubiquitous text editor, for this function, but I soon became tired of having to remember (and type) the various tags needed for EE’s formatting elements (bold, italic, bullet, subtitle, etc.).

Eventually, I decided to create a Microsoft Word template for my article drafts; the key advantage for doing this is that I could add Visual Basic for Applications (VBA) code to the template to automate application of the various EE Article tags, and to include the “article trailer” idea that I shamelessly stole from EE’s leading Article writer, DanRollins.

This article covers how to install and use this template.  Indeed, I wrote this article using the template.

This template uses the old “*.dot” file type, and thus will work for all versions of Word from Word 2000 through Word 2010, without the need to download the Office 2007 Compatibility Pack.


About Word Templates

25
 
LVL 42

Expert Comment

by:dlmille
Comment Utility
Now that's funny.  I did a couple senior projects in college transcribing CEO to TeX and Word to TeX.  

How come computers haven't just "figured it out" and we still have to twist arms to get work done?
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Great stuff, Patrick!
0
When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than manually entering the company name into every place it is needed. This helps greatly to ensure fewer errors and improves efficiency when users fill out the form.

In Word 2003 and prior this could be done by inserting a form field and then referencing it as a book mark. In that scenario, the designer of the form would add the field once and mark it to be bookmarked in the field properties. Then wherever the field would need to be repeated they could hit CTRL-F9 and then enter “{ REF fieldname }” to reference the field. This method still works in Word 2007 and 2010. However, it uses the “legacy” form controls and does not allow you to take advantage of the new controls, such as the date chooser. The legacy reference technique also only allows the user to fill in the information in one field; they cannot enter it into just any of the occurrences throughout the document and have it update the rest.

In Word 2007 and 2010, it is no longer possible to simply bookmark the form control and cross-reference it later in the document. However, since the Word 2007+ (.docx) format is now XML-based, the new Content Control features can be used to reference information in the XML structure. And even better, that XML structure is fully …
4
There is a feature provided by MS Word that lets you create an Table of Contents for your Word document automatically.

To use this feature for other documents there are two steps involved,
  1.  Prepare your document for a table of contents (here you have to highlight which text
       in your document will appear in the table of contents please read the rest of the article
       to know how to do this.)
  2.  Insert the automatic table of contents in your document.

To achieve this please use following steps

For MS Word 2003

Prepare your document for a table of contents :
   1.  On the View menu, point to Toolbars, and click Outlining.
   2.  Select the first heading that you want to appear in the table of contents.
   3.  On the Outlining toolbar, select the outline level that you want to associate with the selected paragraph.
   4.  Repeat steps 2 and 3 for each heading that you want to include in the table of contents.

Insert the automatic table of contents :
   5.  Click where you want to insert the table of contents.
   6.  Go to Insert >> Reference >> Index and Tables  
   7.  Click the Table of Contents tab.
   8.  To use one of the available designs, click a design in the Formats box.
   9.  Select any other table of contents options you want.
 10.  Press Update TOC
 11.  Choose Update the whole documents and not just the page.  In this case it will update
        the page numbers in the Index and Tables.


For MS Word 2007

0
Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed.

With this simple solution, if the user tries to print, a dialog box immediately appears informing the user "This document cannot be printed" (or words of your choosing!) and the print command is cancelled.

You can prevent Word from printing a document by adding a small peice of code which will disable Ctrl+P, File > Print, and the Print toolbar button.

From within your document (or template), click on Tools > Macros > Visual Basic Editor  (or Alt+F11).

In the top left window, double click on 'ThisDocument'.

Simply paste the attached code into the code window on the right, change the message you wish to be displayed, and press Save. Close the Visual Basic Editor, and close your document.

The next time this document is opened, the code will take effect and printing is disabled.

This technique can also be applied to your company templates so that all documents have this feature installed by default.

Dim WithEvents WordApp As Application

Private Sub Document_New()
    Set WordApp = Application
End Sub

Private Sub Document_Open()
    Set WordApp = Application
End Sub

Private Sub WordApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
    
    'Text displayed to the user if they try to print
    strMessage = "This document 

Open in new window

6

Microsoft Word

27K

Solutions

20K

Contributors

Microsoft Word is a commercial document editing program that is part of the Microsoft Office suite. It features numerous text-editing tools for creating richly formatted documents, along with tools for the use of macros in Word documents. Word's native file formats are denoted either by a .doc or .docx file extension. Plugins permitting the Windows versions of Word to read and write formats it does not natively support, such as the OpenDocument format (ODF) are available. Word can import and display images in common bitmap formats such as JPG and GIF. It can also be used to create and display simple line-art.