I need my vb macro in word updating

  • Posted:
  • Proposals: 6
  • Remote
  • #1471136
  • Completed
James M.Tom C.Guilherme R.Saxena S.Virendra Singh B. + 1 other have already sent a proposal.
  • 2


Experience Level: Intermediate
General information for the business: We review documents
Description of requirements/functionality: Currently my vb macro only opens word documents to manipulate in a single directory. I want the macro to open all documents in all sub directories. For example

Folder one: doc 1, doc 2, doc 3, doc 4
Folder two: doc 5, doc 6, doc 7
Folder three: doc 8, doc 9, doc 10

At the moment I have to run my macro for folder one, then folder two, then folder three. I would like to specify a path and for the macro to manipulate documents 1-10 and notify me once it's completed with a audio file being played (I will supply this)

This is my code

Public Sub OpenDocsToProcess()

Dim pWordApp As Object
Dim pWordDoc As Object
Dim pDir As String
Dim pFileName As String

Set pWordApp = CreateObject("word.application")
pWordApp.Visible = True

pDir = InputBox(Prompt:="Enter Directory.", title:="Directory", Default:="DIR HERE")
pFileName = Dir(pDir + "*.doc*")

filename = pFileName
directory = pDir

Do Until Len(pFileName) = 0
Set pWordDoc = pWordApp.Documents.Open(pDir & pFileName)

Fname = pDir & pFileName

Set pWordDoc = Nothing
pFileName = Dir


Set pWordApp = Nothing
End Sub
OS requirements: Windows
Extra notes: We are running Windows 10 and Office 2016

New Proposal

Create an account now and send a proposal now to get this project.

Sign up

Clarification Board Ask a Question

    There are no clarification messages.