I need my vb macro in word updating
- or -
Post a project like this2605
£10(approx. $13)
- Posted:
- Proposals: 6
- Remote
- #1471136
- Completed
Web research|Lead Generation| email database | Linkedin Research | Data Research | Image annotation
Mumbai
819741601801378053142033914462711449433
Description
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)
pWordDoc.Close
Fname = pDir & pFileName
SetNewCriterias
HighlightKeywords
Set pWordDoc = Nothing
pFileName = Dir
Loop
pWordApp.Quit
Set pWordApp = Nothing
MsgBox ("COMPLETE")
End Sub
OS requirements: Windows
Extra notes: We are running Windows 10 and Office 2016
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)
pWordDoc.Close
Fname = pDir & pFileName
SetNewCriterias
HighlightKeywords
Set pWordDoc = Nothing
pFileName = Dir
Loop
pWordApp.Quit
Set pWordApp = Nothing
MsgBox ("COMPLETE")
End Sub
OS requirements: Windows
Extra notes: We are running Windows 10 and Office 2016
Danika C.
100% (5)Projects Completed
5
Freelancers worked with
5
Projects awarded
46%
Last project
2 Jul 2017
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies