M
maperalia
I have a macro that saves an Excel file with specific name and path (see
below).
However, I want to create a macro to save a word file as a doc in the same
way I am doing for excel.
The information I want to take from the word file to create the file name is
location in "Ln7,Col1" and "Ln8,Col1". The path will be C:\Mario\VB\Word and
the file name template is Sample1.dot
Thanks in advance.
Maperalia
Sub SaveExcelFile()
Dim Tract As String
Dim WO As String
Dim Supplier As String
Dim Dates As String
Dim Hours As String
Dim sFilename As String
WO = Worksheets("Gradation Form").Range("G2")
Tract = Worksheets("Gradation Form").Range("G3")
Supplier = Worksheets("Gradation Form").Range("C6")
Dates = Worksheets("Gradation Form").Range("G4")
Hours = Worksheets("Gradation Form").Range("G5")
Progname = "C:\Mario\VB\Excel\" & WO & "_" & Tract & "_" & Supplier & "_" &
Dates & "_" & Hours & ".xls"
ActiveWorkbook.SaveCopyAs Progname
End Sub
below).
However, I want to create a macro to save a word file as a doc in the same
way I am doing for excel.
The information I want to take from the word file to create the file name is
location in "Ln7,Col1" and "Ln8,Col1". The path will be C:\Mario\VB\Word and
the file name template is Sample1.dot
Thanks in advance.
Maperalia
Sub SaveExcelFile()
Dim Tract As String
Dim WO As String
Dim Supplier As String
Dim Dates As String
Dim Hours As String
Dim sFilename As String
WO = Worksheets("Gradation Form").Range("G2")
Tract = Worksheets("Gradation Form").Range("G3")
Supplier = Worksheets("Gradation Form").Range("C6")
Dates = Worksheets("Gradation Form").Range("G4")
Hours = Worksheets("Gradation Form").Range("G5")
Progname = "C:\Mario\VB\Excel\" & WO & "_" & Tract & "_" & Supplier & "_" &
Dates & "_" & Hours & ".xls"
ActiveWorkbook.SaveCopyAs Progname
End Sub