Question

In: Computer Science

1. Open Microsoft Word 2. On the first line, type the words Word VBA Test Bed...

1. Open Microsoft Word

2. On the first line, type the words Word VBA Test Bed

3. Save the document as WordVBATestBed.docm. (It is vital that this is a macro-enabled document.)

4. Ensure that the Developer Tab is visible.

5. Ensure that the Visual Basic Editor is setup in accordance with pages 87 and 88 in the textbook.

6. Insert a module into this document.

7. Add the Option Base 1 instruction under Option Explicit.

4. Using the Visual Basic Editor, create a VBA procedure named create_object that does the following: a. Creates a variable of the Object type. b. Using the Set command, assign the third word of the first paragraph of the active document to the variable. c. Using appropriate methods, make the object bold. d. When you test the procedure, the third word of your document (test) should be bold.

It just needs to have "Option Explicit" at the beginning.

Solutions

Expert Solution

In case of any query, do comment. Please rate answer. Thanks

Please use below code in your module:

Option Explicit

Option Base 1

Sub create_object()

    Dim word As Object 'a. create a variable of object type

   

    'b. Using the Set command, assign the third word of the first paragraph of the active document to the variable

    Set word = ActiveDocument.Paragraphs(1).Range.Words(3)

    ' c. Using appropriate methods, make the object bold , with .Font.Bold set to true

    With word

        .Font.Bold = True

    End With

  

End Sub

================screen shot of the code===============================

Output:


Related Solutions

Name a type of document that can be created with Microsoft Word.
Name a type of document that can be created with Microsoft Word. Using what you have learned from practice, describe the functions of Microsoft Word that aid you in creating the document you named. Describe how you would use the Word functions for creating your document.
2. In a Microsoft Word document, respond to the following: Recently, on the news there was...
2. In a Microsoft Word document, respond to the following: Recently, on the news there was a story about how a local city found itself in quite a financial bind due to the contracts the mayor had signed with the employees union. The contracts were so generous that it left the city with very little money for other things, like parks and festivals. Unfortunately, this type of agency problem is not unique. We see similar problems when school boards agree...
For International Business. I am using Microsoft Word to type this, but you do not have...
For International Business. I am using Microsoft Word to type this, but you do not have to. 1. Create a 3-page (or more) essay on why foreign direct investment (FDI) is important; What are the pros? The cons? The impact?
Name a type of document that can be created with Microsoft Word. Using what you have...
Name a type of document that can be created with Microsoft Word. Using what you have learned from practice, describe the functions of Microsoft Word that aid you in creating the document you named. Describe how you would use the Word functions for creating your document.
In VBA, write a code that does as follows: The first worksheet ("Ex. 1") has a...
In VBA, write a code that does as follows: The first worksheet ("Ex. 1") has a list of 50 numbers. Write a program that will read them into an array, then will calculate and output the following: - How many of the numbers are even (output in E2) - How many of the numbers are greater than 300 (output in E3) - The average of the numbers (output in E4) - In column B, output next to each number, the...
Understanding information security issues Open a new Microsoft® Word document, and enter your answer to one...
Understanding information security issues Open a new Microsoft® Word document, and enter your answer to one of the prompts below: Select two articles that detail hacking tools. Summarize each article and include a concluding paragraph that explains how you as a cybersecurity professional would use these tools. Scan the articles that appeared over the last month. Use those articles to create your own one-page summary of any trends you notice as well as any major events that have occurred. Visit...
Earthquake proof bed. 1. List the system parameter for this bed. 2. What are the engineering...
Earthquake proof bed. 1. List the system parameter for this bed. 2. What are the engineering contradiction about this thing?
Instructions: Type your answer using the Micro soft word, Line spacing should be 1.5 space line...
Instructions: Type your answer using the Micro soft word, Line spacing should be 1.5 space line text. If you wish to sketch then, the sketch should be done with Micro soft word tools. If not use sharp pointed dark pencil draw it on the paper scan and attach in the word file at the suitable position. For 3 marks question you should answer at least one complete page of word document. For 4 marks question you should answer at least...
1. In your own words, what is a nonparametric test? What is a parametric test? 2....
1. In your own words, what is a nonparametric test? What is a parametric test? 2. In your own words, identify an advantage of using rank correlation instead of linear correlation
Bed Sores and Ulcerations 1- Briefly distinguish between a "bed sore" and a "venous ulceration" 2-...
Bed Sores and Ulcerations 1- Briefly distinguish between a "bed sore" and a "venous ulceration" 2- Most cases of bed sores and venous ulcerations in immobile patients is blamed on neglect and abuse. Do you agree this is the most likely cause? Why or why not? 3- Typically, moving / rolling patients is assigned to entry level staff (e.g. Orderly, NA, CNA, LVN, LPN) as opposed to executive level staff (RN, BSN, MSN, NP, DNP, MD, DO). Since this task...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT