MS Word VBA Interview Questions and Answers with Examples

Home/100+ VBA Interview Questions and Answers with Examples/MS Word VBA Interview Questions and Answers with Examples

MS Word VBA Interview Questions and Answers with Examples

MS Word VBA Interview Questions and Answers explained with Example macros. Here are the list of most frequently asked basic MS Word VBA interview questions. All the questions are answered with simple examples. These questions will help you to answer basic questions to deal with MS Word VBA development.

PREMIUM TEMPLATES LIMITED TIME OFFER

ON SALE80% OFF

50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates


Here is the following VBA macro to create a new Word document.
‘Create New Word Document

Sub Create_Documnent()
Documents.Add
End Sub
Here is the following VBA procedure to create a word document from the existing word documnet

'Create new word document based on existing word document
Sub Create_Doc_ReadOnly()
Documents.Add Template:="D:/Test.doc", NewTemplate:=True
End Sub
Here is the following VBA procedure to create a word document as a read only document.

'Open a Existing Word Document (Read Only Document)
Sub Open_Doc_ReadOnly()
Documents.Open FileName:="D:/Test.doc", ReadOnly:=True
End Sub
Here is the following VBA code to save a word document.

'Save Word Document if already not saved
Sub Save_Documnent()
If ActiveDocument.Saved = False Then
ActiveDocument.Save
End If
End Sub
Here is the following VBA procedure to SaveAs a word document.

'SaveAs Word Document if already not saved
Sub SaveAs_Documnent()
ActiveDocument.SaveAs ("d:/Test.doc")
End Sub
Here is the following VBA procedure to create a word document as a read only document.

'Save and Close Document
Sub Save_Close_Document()
Documents.Close SaveChanges:=wdSaveChanges
Application.Quit SaveChanges:=wdSaveChanges
End Sub
Here is the following VBA procedure to create a word document as a read only document.

'Close document without save
Sub DoNotSave_Close_Document()
Documents.Close SaveChanges:=wdDoNotSaveChanges
Application.Quit SaveChanges:=wdDoNotSaveChanges
End Sub
Here is the following VBA code. It takes cursor to the start of the document.
code:

Selection.HomeKey Unit:=wdStory
Here is the following VBA code. It takes cursor to the end of the document.
code:

Selection.EndKey Unit:=wdStory
Here is the following VBA code. It takes cursor to the start of the line.
code:

Selection.HomeKey Unit:= wdLine
Here is the following VBA code. It takes cursor to the end of the line.
code:

Selection.EndKey Unit:= wdLine
Here is the following VBA code. It selects entire word document.
code:

Selection.WholeStory
Here is the following VBA snippet. It selects entire word document.

'Select the current line in a word document
Sub Select_Line_Document()
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
End Sub
Here is the following VBA macro. It changes the font size of third paragraph.

'Change font size of 3rd paragraph
Sub Paragraph_Font_Size_Document()
ActiveDocument.Paragraphs(3).Range.Font.Size = 10
End Sub

More VBA Interview Questions & Answers:

Here is the link for more VBA Interview Questions and Answers. These are explained for examples.
100+ VBA Interview Questions

LIMITED TIME OFFER

Related pages


excel vba create new worksheetvba excel replacevbscript msgbox exampleuserform designgantt chart template free microsoft wordexamples of if statements in excelproject budget spreadsheet templatefind duplicates in excel listhow to add a drop down list in excel 2007meeting minutes template excelhow to unlock excel without passwordvba excel getopenfilenamemacro pivot tableexcel to sql querybasic vlookuphow to delete empty columns in excelexample vlookup formulamacro to delete columnssql pivot explainedhow to add the developer tab in excelhow to declare public variable in vbaexcel macro select caseconcatenation in vbacatia vba tutorialexcel create macrovba excel bookunprotect excel sheet 2007unhide excel rowshow to create a database in excel using vbamsgbox optionsexcel highlight duplicates in columnwhere is the pivot table in excel 2010vba loopingexcel convert to capital letterspivot table descending orderexcel vba protect worksheetactive worksheet vbaexcel hide shortcutsort smallest to largest excelvba excel closevba userform templateswhat is the vlookup functionvlookup meaning in excelvba open file dialogexcel populate comboboxexcel lookup and reference functionsusing sumif excelproject status report dashboard templategantt charts in excel 2007activesheet cellsexcel formulas for averagevba excel isblankdml ddl dcl in sqlformula of vlookupvba save fileexcel vba count rowscommon excel macrosexcel vba if cell containsvba activesheet nameexcel vba sql serverchart wizardunhide sheetshow to unprotect cells in excelvb colour codesquick keys in excelsas programming for beginnerstext box controlexcel remove blank columnsvba save excelexcel format vbavlookup in excel 2010 examplespecialcells vbaexcel functions and formulas with exampleshow to put title on excel graph