Xu Hướng 3/2023 # Word Macro Examples &Amp; Vba Tutorial # Top 6 View | Hoisinhvienqnam.edu.vn

Xu Hướng 3/2023 # Word Macro Examples &Amp; Vba Tutorial # Top 6 View

Bạn đang xem bài viết Word Macro Examples &Amp; Vba Tutorial được cập nhật mới nhất trên website Hoisinhvienqnam.edu.vn. Hy vọng những thông tin mà chúng tôi đã chia sẻ là hữu ích với bạn. Nếu nội dung hay, ý nghĩa bạn hãy chia sẻ với bạn bè của mình và luôn theo dõi, ủng hộ chúng tôi để cập nhật những thông tin mới nhất.

This page contains:

Word VBA Tutorial PDF (Free Download)

Word VBA “Cheat Sheet” containing a list of the most commonly used Word VBA code snippets

Full Word VBA / Macro tutorial.

Searchable list of all of our Word VBA Macro Tutorials

You might also be interested in our Interactive VBA Tutorial for Excel. While some of the examples / exercises are specific to Excel VBA, much of the content is generic to all VBA and you may find it useful to learn concepts like If Statements, Loops, MessageBoxes, and more.

Download our free Microsoft Word VBA Tutorial! Or VBA Tutorials for other Office Programs!

Below you will find simple VBA code examples for working with Microsoft Word.

Select / Go To

Word VBA Macro Tutorial

This is a tutorial for using VBA with Microsoft Word. This tutorial will teach you how to write a simple Macro and interact with Documents, Ranges, Selections, and Paragraphs.

Note: If you’re brand new to Macros / VBA you might also find this article useful: How to write VBA Macros from Scratch.

VBA is the programming language used to automate Microsoft Office programs including Word, Excel, Outlook, PowerPoint, and Access.

Macros are blocks of VBA code that perform specific tasks.

This is a simple example of a Word VBA Macro. It performs the following tasks:

Opens a Word Document

Writes to Document

Closes and Saves the Word Document.

Word Macro Basics

All VBA code must be stored within procedures like this. To create a procedure in VBA type “Sub WordMacroExample” (Where “WordMacroExample” is your desired Macro name) and press ENTER. VBA will automatically add the parenthesis and End Sub.

When interacting with Microsoft Word in VBA, you will frequently reference Word “Objects”. The most common objects are:

Application Object – Microsoft Word itself

Document Object – A Word document

Range Object – A part of a Word document

Selection Object – A selected range or cursor location.

Application is the “top-level” object. All other objects in Word can be reached through it.

In addition to accessing other Word objects, there are “application-level” settings that can be applied:

This is an example of accessing the “Selection” of “Windows(1)” with in the Application:

However, the most common Word objects can be accessed directly, without typing the full hierarchy. So instead, you can (and should) just type:

ActiveDocument

Often, you will have two or more documents opened in Word and you will need specify which specific Word Document to interact with. One way to specify which document is to use ActiveDocument. For example:

…would print the ActiveDocument. The ActiveDocument is the document in Word which “has focus”

To switch the ActiveDocument, use the Activate command:

ThisDocument

Instead of using ActiveDocument to reference the active document, you can use ThisDocument to reference the document where the macro is stored. ThisDocument will never change.

Document Variables

However, for more complicated macros, it can be hard to keep track of the Active Document. It can also be frustrating to switch back and forth between documents.

Instead, you can use Document variables.

This macro will assign the ActiveDocument to a variable and then print the document using the variable:

Document Methods

To Open a Word Document:

We recommend always assigning a Document to a variable upon opening it:

To create a new Word Document:

We can instruct Word to create a new doc based on some template:

As always, it is useful and huge problem saver to assign document to variable upon creating or opening:

To save a document:

or SaveAs:

To close a Document and save changes:

or without saving changes:

This will print the active Document:

Range, Selection, Paragraphs

and are probably the most important objects in Word VBA, certainly the most used.

Range refers to some portion of document, usually, but not necessarily, text.

Selection refers to selected text (or other object like pictures) or, if nothing is selected, an insertion point.

Paragraphs represent paragraphs in document. Its less important than it sounds, because you can’t directly access paragraph text (you need to access particular paragraph range to make modifications).

Range can be any part of document, including entire document:

or it can be small as one character.

Another example, this range would refer to first word in document:

Usually, you would want to get range which refers to specific part of document and then modify it.

In the following example we will make the first word of second paragraph bold:

Set Range Text

To set the text value of a Range:

(Tip: Note the space after “Hello”. Because word object includes space after word, with just “hello” we would get “Hellonext word”)

There are hundreds of things which you can do with ranges. Just a few examples (these assume you are already made object variable oRange referring to range of interest):

Change font Display in message box number of characters in particular range Insert some text before it Add a footnote to range Copy it to clipboard

After above code, oRange would refer to text starting with fifth and ending with 50th character in document.

Selection is even more widely used than Range, because it is easier to work with Selections than Ranges, IF your macro ONLY interacts with the ActiveDocument.

First select the desired part of your document. For example select the second paragraph in active document:

Then you can use the Selection Object to type some text:

We can type some paragraphs bellow “Some text”:

Often, it’s necessary to know if some text is selected or we have just a insertion point:

When working with Selection object we want to place insertion point to particular place, and issue commands starting from this point.

Beginning of document: Beginning of current line:

The Extend parameter wdMove moves the insertion point. Instead, you could use wdExtend which will select all text between the current insertion point.

Move Selection

The most useful method for changing position of insertion point is Move. To move Selection two characters forward:

to move it backwards, use negative number for Count parameter:

Unit parameter can be wdCharacter, wdWord, wdLine, or more (use Word VBA help to see others).

To move words instead:

Selection is easier to work with (compared to ranges) because it is like a robot using Word, mimicking human user. Where Insertion point is – some action would take place. But, this means that you must take care where insertion point is! This is not easy after many steps in code. Otherwise, Word would change text in not desired place.

In the case you need some property or method not available in Selection object you can always easily obtain range associated with selection:

TIP: Using Selection is often easier than using ranges, but also it’s way slower (important when you deal with big documents)

Paragraphs

You can’t directly use Paragraphs object to change text:

Above wouldn’t work (actually it will throw an error). You need to first obtain range associated with particular paragraph:

But you can directly change its style:

or change its paragraph level formatting:

or maybe you want to keep this paragraph on the same line with next paragraph:

Make paragraph centered:

It is VERY useful to assign a particular paragraph to object variable. If we assign particular paragraph to variable we don’t have to worry if the first paragraph becomes the second because we inserted one paragraph before it:

Here is an example where we insert a paragraph above the first paragraph, but we can still reference the old first paragraph because it was assigned to a variable:

Paragraph object is very frequently used in loops:

Word VBA Tutorial Conclusion

This tutorial covered the basics of Word VBA. If you’re new to VBA, you should also review our general VBA Tutorial to learn more about Variables, Loops, MessageBoxes, Settings, Conditional Logic and much more.

Word Macro Examples

PowerPoint VBA FAQs

What is a Word Macro?

A Macro is a general term that refers to a set of programming instructions that automates tasks. Word Macros automate tasks in Word using the VBA programming language.

Does word have VBA?

How do I use VBA in Word?

Words To Describe Yourself In An Interview (40+ Examples)

Hopefully, you are reading this before your interview and not dwelling on the questions you may or may not have answered correctly!

Maybe you’re searching for all the help you can get online before your next big interview.

Either way, being asked to describe yourself is a very common interview question.

There are people who can talk about themselves all day.

In this video, we take a deep dive into some of the best (and worst) words to describe yourself in an interview!

Keep reading and we’ll share some great words to describe yourself and more importantly, sample answers to back those words up.

Below are some good, bad, and controversial words to describe yourself. If you just came here looking for some keywords, this is for you.

If your goal is to absolutely blow someone away in an interview, these keywords alone won’t get you far.

More important than the keywords is the story and supporting evidence that you can provide. Keep reading and we’ll show you exactly how to do this.

Let’s say you can think of a handful of good words on the spot.

Or maybe you’re unsure if the words you think of are any good.

Whatever you do, try to avoid simply listing descriptive words.

Rather, give a short story to support your claim.

Below is a list of appropriate answers to the interview question, “Can you describe yourself in 5 words?”

Diligent / Loyal / Reliable

I am always the first person that my friends call because they know I am always there for them. Night or day, I make sure to take care of the people in my life. I put the same effort into making sure my work is done correctly, and I am always available to help my team members.

Creative / Innovative / Visionary

I love trying new things, creating new methods, and introducing new ideas. In my previous job, I was responsible for selling waterproof phones. One day, I brought in a clear container filled with water to demo the waterproof phones. We made underwater videos and the phone still worked. Once my manager found out, he made this a mandatory practice for all 150 locations.

Motivated / Ambitious / Leader

Honest / Ethical / Conscientious

Ever since I was a little kid I have tried to stay ethical. I remember one time I found six Disneyland tickets and $200 cash in an envelope. I turned the envelope into the store where I found it. My honesty paid off when no one came to claim it and I was able to keep the content.

Friendly / Personable / Extrovert

I’ve always enjoyed meeting new people and maintaining a lot of relationships. I’m your typical extrovert which has really helped me in my career. My natural networking abilities have allowed me to excel in sales roles such as this one.

It is important to think of relevant explanations that also align with the job you are interviewing for.

Be strategic.

There may be 50 words to describe yourself.

However, pick the ones that will be valued most for the position at hand.

Tell them how these words apply to your life and give an example that backs it up.

This may be difficult for those who are shy and have problems opening up, but this is a great life skill.

Don’t be afraid to think about your answer ahead of time so you can shine your character in the best possible light.

Try to avoid general verbiage when you describe yourself.

Some bad words to describe yourself that lack substance include:

Don’t get us wrong, these are positive traits.

They are also very general traits.

That’s why everyone uses them.

These words might describe you, but it could also be assumed in any candidate and will come across as boring.

Think of how many people are going to give these basic answers.

Don’t be like them!

Set yourself apart from the masses and provide truthful character traits that will resonate with the interviewer.

Also, make sure to avoid words that one can perceive as negative such as:

Choose words that can only leave a positive impression.

The goal is to avoid the generic and anything that can come off as negative.

Never, ever, ever say, “I don’t know,” in response to this question!

If you don’t know how to describe yourself, then what else don’t you know?

In other words, it leaves a bad impression.

What leaves a good impression?

Giving a cool, calm, and confident response.

This type of response gives the hiring manager the impression that you are the type of person who comes prepared.

And this can only work in your favor.

Just one reason why it helps to prepare your responses ahead of time!

The best way to prepare for this question is just that.

Prepare!

If you are able to successfully describe yourself in 5 words, you will come off as a confident and capable candidate.

Nobody knows you better than yourself so all you have to do is put it into words!

However, if you really need help thinking of words that describe you, consider asking some friends or family members.

If you are at a loss trying to figure out which words describe you, ask the people who know you best.

Simply text, call, or email a few friends and family members asking “What do you think are words that describe me?”

By asking others what words can be used to describe you (and eliminating the not-so-positive words they might use), you will have a great starting place to come up with your more detailed and descriptive answer for the interview.

If you are interested in taking your interview game to the next level, it’s time to hire an interview coach.

Interview coaches are trained professionals who know what hiring managers want.

Investing in an interview coach can make the difference in landing the job, or coming in second.

Check out our list of the best interview coaching services around.

Good luck! You are going to do great.

30 Examples Of Slang Words From The Past And Today

Slang is very informal language or specific words used by a particular group of people. You’ll usually hear slang spoken more often than you’ll see it put in writing, though emails and texts often contain many conversational slang words.

Though slang sometimes gets a bad rap for being inappropriate or incorrect, it’s also highly creative and shows that the English language is constantly evolving over time. Let’s dive in to 30 examples of slang words from the 1920s to today.

Examples of Outdated Slang

Some slang words that were once popular are no longer used. For example:

Cat’s pajamas: This term was commonly used by flappers in the 1920s to mean that something was exciting, new, or excellent. Though it doesn’t make much sense, it does use vivid imagery.“That new phonograph is the cat’s pajamas.”

Wallflower: This term describes a shy person. It was used for decades in the 20th century to describe a person – typically a girl – who preferred to stand along the wall instead of participating in a dance.“You’ll have more fun at the dance if you aren’t such a wallflower.”

Don’t have a cow: This term is used to try to calm someone down. It was popularized by the TV show The Simpsons in the 1980s and 90s, and though you might still hear Bart say it in reruns, it’s no longer very common to hear in conversation.“Don’t have a cow, mom! I didn’t eat all the ice cream.”

Examples of Evolving Slang

Some slang words change their meaning over time, usually across generations. This keeps the word in usage but can lead to some miscommunication between older and younger speakers. For example:

Busted: To your grandparents, “busted” probably meant that something was broken. To your parents, it means getting caught doing something wrong. The latest use? As an adjective to mean “ugly.”“No, I won’t go out with your little sister. She’s busted.”

Ride: Originally a verb for the act of being a passenger in a vehicle, this word also evolved into a noun to describe a car. Most recently, “my rides” can mean sneakers.“I got new rides to match my favorite shirt.”

Hip: Originally “hip” or “hep” meant someone very fashionable in the first half of the 20th century. It evolved to mean someone into jazz and beatnik culture in the 1940s and 50s, and changed further still into “hippie” to describe flower children of the 60s. Today it’s changed again to “hipster,” meaning a self-aware, artsy person.“My hip grandfather plays the sax, but my hipster brother just makes homemade pickles.”

Examples of Portmanteau Slang

Some slang terms are created by combining two words into one that has a new meaning. A new word created by combining portions of two existing words is called a portmanteau, and they are very popular as a way to give a new name to a celebrity couple. For example, the actors Brad Pitt and Angelina Jolie were known as “Brangelina” when they were married. Other examples of portmanteaus:

Frenemy: This combination of “friend” and “enemy” describes a person who is a little bit of both, perhaps a friend with whom one experiences regular conflict.“You’d be a lot happier if you stopped hanging out with your frenemy.”

Bromance: This combination of “brother” and “romance” describes an intense friendship between two straight men.“I haven’t seen Michael since he started hanging out with Jeremy. Their bromance is epic.”

Ginormous: This combination of “gigantic” and “enormous” means something very large.“You could find a parking space more easily is your car wasn’t so ginormous.”

Examples of Modern Slang

Slang is changing all the time, but here’s a list of modern slang terms:

BAE: A term of endearment, meaning “before anyone else,” used between romantic partners that can also be used between close friends.“Bae, you’re the best.”

Basic: A put-down describing someone or something that’s very common or a conformist.“Those women are so basic. They’re only drinking pumpkin spice lattes because everyone else is.”

Bye Felicia: A fast way to tell someone to go away. This term comes from the 1995 movie Friday.“I know you’re just copying my style. Bye Felicia.”

Coin: Another way to refer to money.“She’s about to earn some major coin.”

Dying: Something that was so funny, you died laughing.“OMG. This standup is hilarious. I’m dying.”

Epic: If somewhat was “epic,” it was highly enjoyable.“His latest novel was epic.”

Extra: If someone’s “extra,” it means they’re way too dramatic.“Her boyfriend was always putting her down, calling her extra.”

Fierce: Usually attributed to Beyonce, “fierce” signifies a strong, independent person.“I love her to death. She’s so fierce!”

GOAT: Current usage is actually a compliment, as this is now an acronym that stands for “greatest of all time.”“I don’t care what you say, because Tom Brady is the goat.”

Lit: If something is “lit,” it means it’s super cool or “on fire.”“Last night’s party was lit.”

Low key: If someone or something is “low key,” it means it’s being done under the radar or they don’t want anyone to know.“I low key love Imagine Dragons, but don’t tell anyone!”

On point: Outstanding, perfectly executed.“Her accessories are on point. She looks great.”

Read: To “read” someone means you’re calling them out for their bad behavior.“Wow. Stefon read Amy for filth at last night’s dinner.”

Salty: Angry or bitter about something.“Why are you so salty? I said I would share if I win the lottery.”

Savage: Someone who “roasts” people nonstop and doesn’t care what others will say.“Jimmy Kimmel’s monologue on Donald Trump last night was savage.”

Ship: Short for “romantic relationship,” sometimes used as a verb.“Everyone wants to ship Edward and bella, but they say they’re just good friends.

The tea: When someone is dishing “the tea,” they’re gossiping, particularly with the juiciest or most dramatic gossip.“Let’s call Wendy. She always has the tea.”

Thirsty: If someone’s “thirsty,” it means they’re a little too eager or even desperate.“Look at the way she dressed for their second date. She’s way too thirsty.”

Throw shade: To “throw shade” means to insult or say something unkind about someone.“I can’t believe he said that. He just threw some serious shade.”

Woke: Slang for “awakened,” as in being highly aware of social injustices.“If you’re so woke, why didn’t you vote?”

YOLO: An acronym for “you only live once,” encouraging people to seize the day.“Of course you should go on that trip to Dublin! YOLO!

Why Do People Use Slang?

Because slang terms are often only understood by people in a certain group, using slang is, above all, a way to show that you belong. You show that you’re one of the crowd by using terms that others don’t understand, and you can connect with like-minded people who understand just what you mean by using the latest slang terms.

For this reason, slang is often a mark of being “cool,” or at least in the know about something. People who are “in” with a group know the slang, and people who aren’t don’t. Slang is, therefore, a way to use language to separate yourself from others. The best example of this is the way each generation of teens uses new slang to separate themselves from their tragically uncool parents.

Over time, slang terms either die out from lack of use as groups move on to new terminology, or they may become so popular that they are absorbed into the common language. In this case, everyone understands the terms, and they aren’t likely to be considered inappropriate or poor grammar any longer. This is how language grows and evolves over time, as new words are added to the dictionary while old ones fall into disuse and disappear.

Picking Up the Lingo

One of the most exciting aspects of the English language is that it’s constantly evolving. As each generation comes of age, it adds new and creative slang to the culture, so you’re sure to hear something new pretty regularly.

90+ Adjectives That Start With J: A List Of Words With Explanation And Examples

jubilantFull of high-spirited delight Police said the two attacks deliberately targeted the jubilant supporters.judaicOf or relating to or characteristic of the jews or their culture or religion The work is representative of the judaic inspiration of the composer.judaicalOf or relating to or characteristic of the jews or their culture or religionjudgmentalDepending on judgment It is otiose and subjectively judgmental.judicableCapable of being judged or decidedjudicialDecreed by or proceeding from a court of justice The highest court of judicial branch is the supreme council of the magistracy.judiciousMarked by the exercise of good judgment or common sense in practical matters Clearly has the judicious and pensive disposition required of an admin.jugularRelating to or located in the region of the neck or throat The botched decapitation in 1945 missed his brain stem and jugular vein.juicelessLacking juicejuicyHaving strong sexual appeal The only juicy bite of steak will be the first.julianOf or relating to or characteristic of julius caesar Julian brazier is a member of the cornerstone group of conservative mps.jumboOf great mass; huge and bulky Improbably, the tying touchdown was caught by offensive tackle jumbo elliott.jumentousSmelling strongly like a beast of burdenjumpyCausing or characterized by jolts and irregular movements Others are so jumpy, it’s embarassing.jungianOf or relating to carl jung or his psychological theories Active imagination is the central technique in jungian therapy.junglyOvergrown with tropical vegetationjuniorIncluding or intended for youthful persons He had the rank of the junior lieutenant.junoesqueSuggestive of a statuejuralOf or relating to law or to legal rights and obligations I think mr jural is not yet up to speed on what this project is all about.jurassicOf or relating to or denoting the second period of the mesozoic era It dates to the jurassic period.juridicRelating to the administration of justice or the function of a judge The reception of a person already baptized has the same juridic effect.juridicalOf or relating to the law or jurisprudence Has he failed to distinguish between the juridical and the sacramental fieldsjurisdictionalRestricted to the geographic area under a particular jurisdiction That is by no stretch a jurisdictional argument.juristicOf or relating to law or to legal rights and obligations But you can use for such juristic problems your mind.jury-riggedDone or made using whatever is available The jury brought in a verdict of acquittal.justFree from favoritism or self-interest or bias or deception; conforming with established standards or rules Is this just a view expressed by right wing jingoist punditsjustifiableCapable of being justified I added the reasons why i believe the article is justifiable.justificativeAttempting to justify or defend in speech or writingjustificatoryAttempting to justify or defend in speech or writing It is not impossible for an infinite justificatory series to exist.justifiedHaving words so spaced that lines have straight even margins John justified his claim more clearly.juvenileDisplaying or suggesting a lack of maturity Yet there is more juvenile delinquency and more alienation among the young.

Cập nhật thông tin chi tiết về Word Macro Examples &Amp; Vba Tutorial trên website Hoisinhvienqnam.edu.vn. Hy vọng nội dung bài viết sẽ đáp ứng được nhu cầu của bạn, chúng tôi sẽ thường xuyên cập nhật mới nội dung để bạn nhận được thông tin nhanh chóng và chính xác nhất. Chúc bạn một ngày tốt lành!