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


how to alphabetize rows in excelhow to locate duplicates in excelcountif excel exampleexcel 2013 advanced filterfilter excel macrovba unprotect all sheetsunlock excel file passwordvba converterhyperlink excel formulavba string starts withactivate sheet vbaautomatically refresh pivot tableexcel startup macrovba remove duplicateshow to merge multiple columns in excelreplace function in excel 2007vba meaningsql orderedvba xlrighthow to use the sumif functionvba excel progress barexcel fixed rowsorting tabs in excelrefresh excel spreadsheetexcel formulas and functions examplesmultiple if and statements in excelprograming in excelexcel interactive graphdelete even rows in excelvba excel cells.findpivot chart tutorialautofit on excelmicrosoft excel developer tabddl and dml in sql serveradd developer tab to ribbon in microsoft wordvba hyperlinkshow to unlock a password protected excel workbookexcel formulas hlookuphow to enable macro in excelcombine multiple cells in excelhighlight duplicates excel 2010building a graph in excelwhat is the purpose of vlookup function in excelwhat does vlookup stand forvba secondsmessage box in vbavba application in excelword vba examplesmicrosoft excel macro examplesvba displaywindows.activate vbacreate a check box in excelexcel macro arrayexcel workbook passwordhow to unprotect excel with passwordexcel macros buttonexcel vba open csv filevba delete rowsexcel activesheetvlookup example between two sheetsvba concatenationunprotect protected excel sheetvba copy sheet to new workbooksql groupingvba replace methodhow do you unhide in excelhdr yes imex 1macro programingvba access export to excelcolor code in vbaadd developer tab to ribbon word 2007vba excel chartsunhide rows in excelwhat is a userform in excellearning excel macrosecure excel spreadsheetnested if vba excelexcel pivot table shortcut keybatch file append to text file