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


entirerow deleteproject roadmap template excelhow to copy a worksheet in excelhow to add tick box in excelvba userform initializevb exit forlist of shortcut keys in exceltick box in excel 2007application calculation xlcalculationmanualvba integer rangeexcel vba endhow to find duplicates in an excel columnvba code for accessvba excel to wordvba and macrosexcel 2010 remove password protectionconstruction schedule excel templatepivot chart tutorialbox plot excel 2010 templateexcel 2013 merge cellsvba variablesword templates agendaexcel vba activate workbookvba code to read excel fileprotected worksheetexcel auto fitunprotect excel documenttwo if statements in one cell excelexcel project dashboard templateexcel nested ifssave vba excelexcel 2013 sumifvba file browservba fileformatproject portfolio management excel templatevb net excel set column widthexcel formulas monthdynamic array excelhow many rows and columns are in excelvb scripting in excelexcel duplicate deletewriting vbaexcel function isnaexcel vba lookup valuepivot table graphshortcut key in excelexcel event calendar templateexcel vba range resizeexcel vba sampleexcel vba tutorialssimple gantt chart excel templateexcel password protect workbookexplain cut copy and pastexml to excel converterexcel surface chartexcel find duplicates formulaif function in excel 2007 with exampleuse of vlookup function in exceldelete all duplicates in excelproject timeline template excelexcel surface chartexcel function trimvb excel arrayalign charts in excelexcel hlookupreverse cell order exceldml and ddl queriestext box controlhow to check duplicates in excelsql recordsethow to insert macro in excel 2007excel vba rangesexcel vba applicationsvbscript msgbox examples