Hi Everyone I am very new to coding but have been having some success by teaching myself, I learn or am able to figure things out most easily by reverse engineering I apologise if this seems overly simple but I have not been able to find any relevant examples to convert.
I am trying to write a code in VBA that opens and prints a set of files based on an array derived from the current date or alternatively from an input box
The filenames are all date specific ddmmyyarea1
i.e. 180818area1
What I need it to do is
Get todays date i.e. 17/08/18 +1 to have date 18/08/18
open the files that contain that date in their name 180818area1 then 180818area2 and so on
the reason I haven't asked for the whole script is that I prefer to learn by putting the basic building blocks together, however I am struggling on this aspect above
thanks in advance
Below is my 'estimate' of what I think the code might look like, once again I am very new to this:
Sub BatchPrintWordDocuments()
Dim objWordApplication As New Word.Application
Dim strFile As String
Dim strFolder As String
InputBox("Enter the date to print ddmmyy")
strFolder = file path
strFile = Dir(strFolder & InputBox & Area* vbNormal)
While strFile <> ""
With objWordApplication
.Documents.Open (strFolder & strFile)
End With
strFile = Dir()
Wend
Set objWordApplication = Nothing
End Sub