B
blanic via AccessMonster.com
Ok, i have found such a great place here, you guys have been very helpful, so
here's another quandry for you.
I open up my word document using access, I pass the margins I want, now I
want to BOLD everything in the document, without using a template or macro,
just sending paramaters from access. Is this possible?
Here is my code that opens the document and sets the margins.
Dim wdApp As Word.Application
Dim doc As Word.Document
Dim RetVal
Dim TheDate As String ' Declare variables.
Dim Today As String
Dim Year As String
Dim Yar As String
Dim Month As String
Dim Mont As String
Dim FS As New FileSystemOBject
Dim SourceFile, DestinationFile
TheDate = Now
Today = DatePart("d", TheDate)
Year = DatePart("yyyy", TheDate)
Yar = Right(Year, 2)
Month = DatePart("m", TheDate)
Mont = IIf(Month = 1, "Jan", IIf(Month = 2, "Feb", IIf(Month = 3, "Mar", IIf
(Month = 4, "Apr", IIf(Month = 5, "May", IIf(Month = 6, "Jun", IIf(Month = 7,
"Jul", IIf(Month = 8, "Aug", IIf(Month = 9, "Sep", IIf(Month = 10, "Oct", IIf
(Month = 11, "Nov", "Dec")))))))))))
Set wdApp = New Word.Application
wdApp.Visible = True
Set doc = wdApp.Documents.Open("E:\CGinst\RPTS\" + Yar + "\" + Mont + "\2333.
" + Today)
With wdApp.ActiveDocument.PageSetup
.TopMargin = InchesToPoints(0.35)
.BottomMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.LeftMargin = InchesToPoints(0.25)
End With
here's another quandry for you.
I open up my word document using access, I pass the margins I want, now I
want to BOLD everything in the document, without using a template or macro,
just sending paramaters from access. Is this possible?
Here is my code that opens the document and sets the margins.
Dim wdApp As Word.Application
Dim doc As Word.Document
Dim RetVal
Dim TheDate As String ' Declare variables.
Dim Today As String
Dim Year As String
Dim Yar As String
Dim Month As String
Dim Mont As String
Dim FS As New FileSystemOBject
Dim SourceFile, DestinationFile
TheDate = Now
Today = DatePart("d", TheDate)
Year = DatePart("yyyy", TheDate)
Yar = Right(Year, 2)
Month = DatePart("m", TheDate)
Mont = IIf(Month = 1, "Jan", IIf(Month = 2, "Feb", IIf(Month = 3, "Mar", IIf
(Month = 4, "Apr", IIf(Month = 5, "May", IIf(Month = 6, "Jun", IIf(Month = 7,
"Jul", IIf(Month = 8, "Aug", IIf(Month = 9, "Sep", IIf(Month = 10, "Oct", IIf
(Month = 11, "Nov", "Dec")))))))))))
Set wdApp = New Word.Application
wdApp.Visible = True
Set doc = wdApp.Documents.Open("E:\CGinst\RPTS\" + Yar + "\" + Mont + "\2333.
" + Today)
With wdApp.ActiveDocument.PageSetup
.TopMargin = InchesToPoints(0.35)
.BottomMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.LeftMargin = InchesToPoints(0.25)
End With