Hello All,
I am hoping someone can help me with some Word macros.
We have several macros that were created long before me and up until recently they worked find using Office 2016. However, we have switched over to Office 2019 and now they work but not quite right. What I mean by that is, while for the most part the macros work, the line spacing is off. Below is a snippet of one of the macros. Where it says, "WordBasic.insertpara" it should drop down to the next line, which it does. However, the line spacing used to be single space and is now double spaced. How do I fix this to get it to work with our new version of Office?
Public Sub MAIN()
Dim Nme$
Dim N$
Dim Addr$
Dim A$
Dim Csz$
Dim C$
Dim Acct$
Dim Ac$
Dim Ploc$
Dim Loc_$
Dim Bal$
Dim Dbal$
Dim Sal$
Dim S$
Dim Ploc2$
Dim Loc2$
Dim Dt$
Dim D$
Dim Ploc3$
Dim Loc3$
Dim Dt2$
Dim D2$
Rem ACTUAL
Rem Collection letter
Rem Changed Bev Eick to E. Borsini
Rem Changed Borsini to McRae
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = InchesToPoints(1)
.BottomMargin = InchesToPoints(1)
.LeftMargin = InchesToPoints(1)
.RightMargin = InchesToPoints(1)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0)
.FooterDistance = InchesToPoints(0)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLowerBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
WordBasic.RightPara
WordBasic.InsertField Field:="CREATEDATE \@ " + Chr(34) + "MMMM d, yyyy" + Chr(34) + " \* MERGEFORMAT"
WordBasic.CharLeft 1
WordBasic.UnlinkFields
WordBasic.CharRight 1
WordBasic.insertpara
WordBasic.insertpara
WordBasic.JustifyPara
Nme$ = WordBasic.[InputBox$]("Please enter customer name", N$)
WordBasic.insert Nme$
WordBasic.insertpara
Addr$ = WordBasic.[InputBox$]("Please enter customer address", A$)
WordBasic.insert Addr$
WordBasic.insertpara
Csz$ = WordBasic.[InputBox$]("Please enter city, state and zip code", C$)
WordBasic.insert Csz$
[highlight #FCE94F]WordBasic.insertpara
WordBasic.insertpara[/highlight]
WordBasic.insert "Re: Account Number: "
Acct$ = WordBasic.[InputBox$]("Please enter account number", Ac$)
WordBasic.insert Acct$
WordBasic.insertpara
WordBasic.insert "Property Location:
I am hoping someone can help me with some Word macros.
We have several macros that were created long before me and up until recently they worked find using Office 2016. However, we have switched over to Office 2019 and now they work but not quite right. What I mean by that is, while for the most part the macros work, the line spacing is off. Below is a snippet of one of the macros. Where it says, "WordBasic.insertpara" it should drop down to the next line, which it does. However, the line spacing used to be single space and is now double spaced. How do I fix this to get it to work with our new version of Office?
Public Sub MAIN()
Dim Nme$
Dim N$
Dim Addr$
Dim A$
Dim Csz$
Dim C$
Dim Acct$
Dim Ac$
Dim Ploc$
Dim Loc_$
Dim Bal$
Dim Dbal$
Dim Sal$
Dim S$
Dim Ploc2$
Dim Loc2$
Dim Dt$
Dim D$
Dim Ploc3$
Dim Loc3$
Dim Dt2$
Dim D2$
Rem ACTUAL
Rem Collection letter
Rem Changed Bev Eick to E. Borsini
Rem Changed Borsini to McRae
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = InchesToPoints(1)
.BottomMargin = InchesToPoints(1)
.LeftMargin = InchesToPoints(1)
.RightMargin = InchesToPoints(1)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0)
.FooterDistance = InchesToPoints(0)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.FirstPageTray = wdPrinterLowerBin
.OtherPagesTray = wdPrinterLowerBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With
WordBasic.RightPara
WordBasic.InsertField Field:="CREATEDATE \@ " + Chr(34) + "MMMM d, yyyy" + Chr(34) + " \* MERGEFORMAT"
WordBasic.CharLeft 1
WordBasic.UnlinkFields
WordBasic.CharRight 1
WordBasic.insertpara
WordBasic.insertpara
WordBasic.JustifyPara
Nme$ = WordBasic.[InputBox$]("Please enter customer name", N$)
WordBasic.insert Nme$
WordBasic.insertpara
Addr$ = WordBasic.[InputBox$]("Please enter customer address", A$)
WordBasic.insert Addr$
WordBasic.insertpara
Csz$ = WordBasic.[InputBox$]("Please enter city, state and zip code", C$)
WordBasic.insert Csz$
[highlight #FCE94F]WordBasic.insertpara
WordBasic.insertpara[/highlight]
WordBasic.insert "Re: Account Number: "
Acct$ = WordBasic.[InputBox$]("Please enter account number", Ac$)
WordBasic.insert Acct$
WordBasic.insertpara
WordBasic.insert "Property Location: