Thursday, March 19, 2020

Foreshadowing What is Foreshadowing How to Use it (Sneakily)

Foreshadowing What is Foreshadowing How to Use it (Sneakily) Foreshadowing: What is Foreshadowing How to Use it (Sneakily) Without foreshadowing in your bookyou run the risk of an unsatisfying story.Let’s be honest, how many of us pick up a book, read half of it, get busy and never get back to it?Life or other books get in the way and, well, as good as that book was, we were never really hooked. There was nothing compelling us to read to the end.No harm, no foul, right?Wrong.When you’re the author of that halfsOne of the best ways to learn any skill, including foreshadowing, is to look at examples and understand why they were done.Here are some of our top foreshadowing examples (you probably recognize) that you can learn from in order to put these writing tips to use.Foreshadowing Example #1 Nightlock in Hunger GamesBy now, we all pretty much know the story of Katniss Everdeen, the selfless sister who bravely sacrificed herself as a Hunger Game competition in order to save her younger sister.This series has a number of fantastic foreshadowing examples, but one that sticks out to us the mos t is the prevalence of nightlock, a poisonous berry that causes death upon consumption.These are the instances in which the use of nightlock is used as foreshadowing:In the beginning of the book, we learn that Katniss is well #2 Obi #3 Lennie Killing in Of Mice and MenIf youre familiar with Of Mice and Men (meaning, if your teachers made you read it in school), you know that Lennie, a mentally delayed man, kills his puppy by being too rough with it #4 The Prologue in Game of ThronesIf youve read George R.R. Martins Game of Thrones, you know just how vital the prologue of the series is- they even recreated this perfectly in the HBO show.The White Walkers in Game of Thrones are among the biggest threats in the world Martin has created. They become the center of conflict and dread.Martin foreshadows this from the very, very beginning by narrating some men venturing beyond the wall, all thinking the White Walkers are just a myth- a legend meant to scare children at bedtime.The end of the the prologue in Game of ThronesDuring this prologue (spoiler alert), all the men, aside from one man of the Nights Watch, are killed.This single man runs away (from The Wall) and is intercepted in Winterfell as a deserter, where he tells this story to those who dont believe him. This is the key foreshadowing moment of the potential horror the white walkers induce in this series.The Power of Foreshadowing and the Writer’s 6th SenseLet’s talk about one of the greatest plot twists in modern cinematic history: The 6th Sense.Before I go on, spoiler alert!.. you have been warned!If we weren’t prepared for the surprising fact that Bruce Willis’ character was actually dead, we’d meet that final, climactic reveal with confusion and anger. Instead, M. Night Shyamalan painstakingly prepares us with visual effects like one’s misty breath when a ghost appears, he has Haley Joel Osment tells out outright that some ghosts, â€Å"Don’t even kno w that they’re dead,† and when the reveal finally happens, it’s met with a montage of all the moments that M. Night Shyamalan foreshadowed that shocking plot twist.And most of us still left the theatre going: â€Å"I didn’t see that coming.†What none of us did do was leave the theater disappointed or confused, saying, â€Å"Well that came out of nowhere.† Make no mistake, when used correctly, foreshadowing can be more of your most powerful tools in keeping your reader hooked.How to Use Foreshadowing in Your NovelThere are five common foreshadowing techniques that will never get old.Use them wisely and readers will be hooked for life (and give you those 5-star Amazon reviews).#1 ProphecyWith ultimate power comes ultimate†¦knowledge? Wait†¦that’s not right.But what is right is that as the author, you possess god-like powers over your characters. You make them do, say or think anything. You know what is going to happen to them down to the last word they utter. You’ve seen it all.You can see the future!Trouble is, it’s all in your head.That’s when you can use a prophetic character or event in your book to foreshadow what’s coming. It could come in the form of an actual prophet screaming from the hilltops that the ‘end is nigh’†¦ and then the end actually becomes nigh.Or some wise old man who says something like, â€Å"When I was a young lad, those dark clouds meant a storm was coming.†One example of this foreshadowing in books is Professor Trelawney in J.K. Rowlings Harry Potter.Professor Trelawney is seen as a fraud by many (if not all) of her students, particularly when she has her episodes. However, Rowling wrote this in such a way that you as a reader also dont believe what shes saying is truewhen in fact, it is.Whatever you choose to do, use your secondary characters in your book to prophesize (foreshadow) events yet to come.# 2 Chekov’s Gun There is an old rule in writing, known as Checkovs Gun: If you see a gun in Act One, it better go off in Act Three.I find that the opposite is equally true. If a gun goes off in Act Three, you better have shown it earlier.By focusing on some detail, especially one that isn’t immediately obvious as important, you are essentially giving your reader a heads up that this will come back in some significant way later on in the story.A famous (non-gun) example of this is the Nightlock poisonous berries in the Hunger Games, as we mentioned in the examples above. At the climax of the book (spoiler alert), Katniss threatens to commit suicide by eating the berries.This is foreshadowed three times:First, at the beginning of the book when we see her out in the wilderness, foraging for food. We learn that she knows what’s poisonous and what’s not.The second time occurs at the Capital when she is training for the Games. In that scene, we actually read about Nightlock.The third time is when, during the Games, Katniss finds a dead tribute who accidently poisoned herself by eating the berries.We saw the gun, ahhh, I mean berries, several times before that big climactic moment.And because of that, we knew they’d be important (and we also didn’t think, â€Å"Well, isn’t that convenient† when they did show up.In other words, the author foreshadowed that big final moment.#3 OmensRed sky at night, shepherds delight. Red sky in the morning, shepherds warning.OK, so if your main character is a shepherd and it’s about to go down, then delight your readers with a dawn that lights the sky blood red.What are omens?Omens, or common cultural symbols, can be extremely effective tools when foreshadowing a coming plot point.Here are some examples of common omens in fiction:A black cat for bad luckA four-leaf clover for good luckWalking under a ladderFinding a penny heads upA crow symbolizing deathNOTE for foreshadowing with omens: You do n’t have to stick to omens from our world. Make them up! For example, if you’re writing a novel thats set in some magical kingdom or a distant planet, ask yourself, â€Å"What are the ‘omens’ they have?†It could be anything†¦ touching a Minotaur’s horn, seeing a mermaid, the three moons simultaneously appearing in the morning sky, etc.,†¦Just make sure that whatever you decide, you adequately explain it to the reader, too.#4 I Got This Weird FeelingThree characters walk into an abandoned cabin. One of them says, â€Å"I got a bad feeling about this†¦Ã¢â‚¬  and BOOM!You’re away to the foreshadowing races!Here’s the literary schtick: In real life, when your mom calls you because she had a bad dream about you getting hit by a bus, it’s just her being overprotective. (Jeez mom, chill. I’ll look both ways when I cross the road. I promise.)But in fiction, if a character’s mother calls them with t hat same bad dream, it better be foreshadowing events to come (or don’t include that little tidbit at all).#5 Outline your book for better foreshadowingIts very, very hard to drop foreshadowing hints if you have no idea where your book is going.For that reason, outlining your book will help you create much stronger (and sneakier) foreshadowing elements. Think of it this way: the more you know about your own story, the better foreshadowing bits and pieces you can leave behind in order to hide them better from your readers.#6 Flashbacks/Flash ForwardsSetting a scene outside of the narrative timeline can also be an effective foreshadowing tool.For example, you could have a flash forward scene with a sinking ship, then return to the story’s present time, three hours earlier, and the reader can watch with delight as the hero boards that very same ship.Oh boy- someone gonna drown!Or, a character could walk into a room and smell a strange, meaty odor that leads to a flashba ck of a time when he was fighting a gang of cannibals who were barbequing his buddy.Oh wait- someone is getting grilled!These elements are very helpful in creating foreshadowing but remember that flashbacks and flash-forwards should also show up elsewhere in your novel instead of just for a single foreshadowing event.So there you have it, foreshadowing and all its mighty powers. Use this tool wisely, young Padowan, and I promise, you’ll have your reader frantically turning the pages until the glorious end.Are you ready to write a bestselling novel?If youre ready to write a book that leaves readers with their jaws on the floor, heres where you can start.

Tuesday, March 3, 2020

Learn VBA Macro Coding Word 2007

Learn VBA Macro Coding Word 2007 The goal of this course is to help people who have never written a program before learn to write one. Theres no reason why office workers, homemakers, professional engineers and pizza delivery persons shouldnt be able to take advantage of their own hand crafted custom computer programs to work faster and smarter. It shouldnt take a professional programmer (whatever that is) to do the job. You know what needs to be done better than anyone else. You can do it yourself! (And I say this as someone who has spent many years writing programs for other people ... professionally.) With that said, this is not a course in how to use a computer. This course assumes that you know how to use popular software and in particular, that you have Microsoft Word 2007 installed on your computer. You should know basic computer skills like how to create file folders (that is, directories) and how to move and copy files. But if youve always wondered what a computer program actually was, thats OK. Well show you. Microsoft Office isnt cheap. But you can get more value from that expensive software you already have installed. Thats a big reason we use Visual Basic for Applications, or VBA, along with Microsoft Office. There are millions who have it and a handful (maybe no one) who uses everything it can do. Before we go any further, however, I need to explain one more thing about VBA. In February 2002, Microsoft made a 300 billion dollar bet on a totally new technology base for their entire company. They called it .NET. Since then, Microsoft has been moving their entire technology base into VB.NET. VBA is the very last programming tool that still uses VB6, the tried and true technology that was used before VB.NET. (Youll see the phrase COM based to describe this VB6 level technology.) VSTO and VBA Microsoft has created a way to write VB.NET programs for Office 2007. Its called Visual Studio Tools for Office (VSTO). The problem with VSTO is that you have to buy and learn to use Visual Studio Professional.  Excel itself is still COM based too and .NET programs have to work with Excel through an interface (called the PIA, Primary Interop Assembly). So ... until Microsoft gets their act together and gives you a way to write programs that will work with Word and doesnt make you join the IT department, VBA macros are still the way to go. Another reason we use VBA is that it really is a fully baked (not half baked) software development environment that has been used for years by programmers to create some of the most sophisticated systems in existence. It doesnt matter how high your programming sights are set. Visual Basic has the power to take you there. What is a macro? You may have used desktop applications that support what is called a macro language before. Macros are traditionally just scripts of keyboard actions grouped together with one name so you can execute them all at once. If you always start the day by opening your MyDiary document, entering todays date, and typing the words, Dear Diary, Why not let your computer do that for you? To be consistent with other software, Microsoft calls VBA a macro language too. But its not. Its much more. Many desktop applications include a software tool that will let you record a keystroke macro. In Microsoft applications, this tool is called the Macro Recorder, but the result is not a traditional keystroke macro. Its a VBA program and the difference is that it does not simply replay the keystrokes. A VBA program gives you the same end result if possible, but you can also write sophisticated systems in VBA that leave simple keyboard macros in the dust. For example, you can use Excel functions in Word using VBA. And you can integrate VBA with other systems like databases, the web, or other software applications. Although the VBA Macro Recorder is very useful for simply creating simple keyboard macros, programmers have discovered that its even more useful to give them a running start in more sophisticated programs. Thats what were going to do. Start Microsoft Word 2007 with a blank document and get ready to write a program. The Developer tab in Word One of the first things that you have to do to write Visual Basic program in Word 2007 is find Visual Basic! The default in Word 2007 is to not display the ribbon that is used. To add the Developer tab, first click the Office button (the logo in the upper left corner) and then click Word Options. Click Show Developer tab in the Ribbon and then click OK. When you click the Developer tab, you have a whole new set of tools used to write VBA programs. Were going to use the VBA Macro Recorder to create your first program. (If the ribbon with all your tools keeps disappearing, you might want to right-click the ribbon and make sure Minimize the Ribbon is not checked.) Click Record Macro. Name your macro: AboutVB1 by typing that name in the Macro Name textbox. Select your current document as the location to store your macro and click OK. See the example below. (Note: If you pick All Documents (Normal.dotm) from the drop down menu, this test VBA program will, in effect, become a part of Word itself because it will then become available for every document you create in Word. If you only want to use a VBA macro in a specific document, or if you want to be able to send it to someone else, its a better idea to save the macro as part of the document. Normal.dotm is the default so you must change it.) With the Macro Recorder turned on, type the text, Hello World. into your Word document. (The mouse pointer will change into a miniature picture of a tape cartridge to show that keystrokes are being recorded.) (Note: Hello World is almost required for a First Program because the very first programming manual for the early computer language C used it. Its been a tradition ever since.) Click Stop Recording. Close Word and save the document using the name: AboutVB1.docm. You have to select a Word Macro-Enabled Document from the Save as Type dropdown. Thats it! You have now written a Word VBA program. Lets see what it looks like! Understanding what a VBA program is If you have closed Word, open it again and select the AboutVB1.docm file that you saved in the previous lesson. If everything was done correctly, you should see a banner at the top of your document window with a security warning. VBA and Security VBA is a real programming language. That means that VBA can do just about anything you need it to do. And that, in turn, means that if you receive a Word document with an embedded macro from some bad guy that macro can do just about anything too. So Microsofts warning is to be taken seriously. On the other hand, you wrote this macro and all it does is type Hello World so theres no risk here. Click the button to enable macros. To see what the Macro Recorder has created (as well as to do most other things that involve VBA), you need to start the Visual Basic Editor. Theres an icon to do that at the left side of the Developer ribbon. First, notice the left hand window. This is called the Project Explorer and it groups together the high level objects (well talk more about them) that are part of your Visual Basic project. When the Macro Recorder was started, you had a choice of the Normal template or the current document as a location for your macro. If you selected Normal, then the NewMacros module will be part of the Normal branch of the Project Explorer display. (You were supposed to select the current document. If you did select Normal,  delete the document and repeat the previous instructions.) Select NewMacros under Modules in your current project. If there still isnt any code window displayed, click Code under the View menu. The Word document as a VBA container Every Visual Basic program must be in some kind of file container. In the case of Word 2007 VBA macros, that container is a (.docm) Word document. Word VBA programs cant run without Word and you cant create standalone (.exe) Visual Basic programs like you can with Visual Basic 6 or Visual Basic .NET. But that still leaves a whole world of things you can do. Your first program is certainly short and sweet, but it will serve to introduce the major features of VBA and the Visual Basic Editor. The program source will normally consist of a series of subroutines. When you graduate to more advanced programming, youll discover that other things can be part of the program besides subroutines. This particular subroutine is named AboutVB1. The subroutine header must be paired with an End Sub at the bottom. The parenthesis can hold a parameter list consisting of values being passed to the subroutine. Nothing is being passed here, but they have to be there in the Sub statement anyway. Later, when we run the macro, we will look for the name  AboutVB1. There is only one actual program statement in the subroutine: Selection.TypeText Text:Hello World! Objects, methods and properties This statement contains the big three: an objecta methoda property The statement actually adds the text Hello World. to the contents of the current document. The next task is to run our program a few times. Just like buying a car, its a good idea to drive it around for a while until it feels a little bit comfortable. We do that next. Programs and documents We have our glorious and complicated system ... consisting of one program statement ... but now we want to run it. Heres what thats all about. Theres one concept to be learned here that is very important and it often really confuses first timers: the difference between the program and the document. This concept is foundational. VBA programs have to be contained in a host file. In Word, the host is the document. In our example, thats AboutVB1.docm. The program is actually saved inside the document. For example, if this was Excel, we would be talking about the program and the spreadsheet. In Access, the program and the database. Even in standalone Visual Basic Windows application, we would have a program and a form. (Note: There is a trend in programming to refer to all high level containers as a document. This is specifically the case when XML ... another up and coming technology ... is being used. Dont let it confuse you. Although its a slight inaccuracy, you can think of documents as being roughly the same as files.) There are ... ummmmm .... about three main ways to run your VBA macro. You can run it from the Word Document.(Note: Two subcategories are to select Macros from the Tools menu or just press Alt-F8. If you have assigned the macro to a Toolbar or Keyboard shortcut, thats one more way.))You can run it from the Editor using the Run icon or Run menu.You can single-step through the program in debug mode. You should try every one of these methods just to become comfortable with the Word/VBA interface. When you finish, you will have a whole document filled with repeats of Hello World! Running the program from Word is fairly easy to do. Just select the macro after clicking the Macro icon under the View tab. To run it from the Editor, first open the Visual Basic editor and then either click the Run icon or select Run from the menu. Heres where the difference between the Document and the Program might become confusing to some. If you have the document minimized or perhaps have your windows arranged so the editor is covering it, you can click the Run icon over and over and nothing seems to happen. But the program is running! Switch to the document again and see. Single stepping through the program is probably the most useful problem solving technique. This is also done from the Visual Basic editor. To try this out, press F8 or select Step Into from the Debug menu. The first statement in the program, the Sub statement, is highlighted. Pressing F8 executes the program statements one at a time until the program ends. You can see exactly when the text is added to the document this way. There are a lot of more refined debugging techniques such as Breakpoints, examining program objects in the Immediate Window, and the use of the Watch Window. But for now, simply be aware that this is a primary debugging technique you will use as a programmer. Object Oriented Programming The next class lesson is all about Object Oriented Programming. Whaaaattttt! (I hear you moaning) I just want to write programs. I didnt sign up to be a computer scientist! Fear Not! There are two reasons why this is a great move. First, in todays programming environment, you simply cant be an effective programmer without understanding object oriented programming concepts. Even our very simple one-line Hello World program consisted of an object, a method, and a property. In my opinion, not understanding objects is the biggest single problem beginning programmers have. So were going to confront the beast right up front! Second, were going to make this as painless as possible. Were not going to confuse you with a load of computer science jargon. But right after that, were going to jump right back into writing programming code with a lesson where we develop a VBA macro that you can probably use! We perfect that program a little more in the next lesson and finish up by showing you how to start using VBA with several applications at one time.