Bolding a word doc from Access

  • Thread starter blanic via AccessMonster.com
  • Start date
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
 
G

Guest

Hi

Tuck this in at the end (I've added a couple of other lines to give you an
idea of what else is possible:

Set ftRng = wdApp.ActiveDocument.Content
With ftRng.Font
.Bold= True
.Name = "Arial"
.Size = "10"
.Italic = True
.Underline = wdUnderlineSingle
End With

Good luck

BW
 
B

blanic via AccessMonster.com

BeWyched said:
Hi

Tuck this in at the end (I've added a couple of other lines to give you an
idea of what else is possible:

Set ftRng = wdApp.ActiveDocument.Content
With ftRng.Font
.Bold= True
.Name = "Arial"
.Size = "10"
.Italic = True
.Underline = wdUnderlineSingle
End With

Good luck

BW
Ok, i have found such a great place here, you guys have been very helpful, so
here's another quandry for you.
[quoted text clipped - 40 lines]
.LeftMargin = InchesToPoints(0.25)
End With


Dude You so rock!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top