Access in VBA - Come si fa a modificare testo nel'intestazione di file Word

golfmike

Nuovo Utente
1 Feb 2013
6
0
0
da un bottone di una Form di access (2003) dovrei creare un file Word . Fin'ora sono riuscito a creare il file e gestire l'inserimento del testo su tre righe nell'intestazione, ma il problema sorge nel punto in cui devo modificare tipo di carattere altezza dello stesso per ogni riga dell'intesazione es.
1° riga altezza 16 in arial
2° riga aletzza 14 in Tahoma
3° riga altezza 12 in Times New Roman
ho provato a ricercare la soluzione nella gestione della proprieta Paragraphs, ma non sono giunto a nulla qual'è la procedura?
grazie per i suggerimenti

questo è il codice finora utilizzato

Private Sub Btn_Word_Click()
Dim objWRD As Word.Application, myDoc As Word.Document, ReplSel As Boolean, Vtxt_Hdr, VPath, VNm_Fl As String

Set objWRD = CreateObject("Word.Application")


objWRD.Visible = True
objWRD.Activate
ReplSel = objWRD.Options.ReplaceSelection
objWRD.Options.ReplaceSelection = True
objWRD.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

objWRD.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
objWRD.Selection.HeaderFooter.Range.Paragraphs.Ali gnment = wdAlignParagraphCenter
objWRD.Selection.HeaderFooter.Range.Paragraphs.Lin eSpacingRule = wdLineSpaceSingle
objWRD.Selection.HeaderFooter.Range.Paragraphs.Spa ceAfter = 0
objWRD.Selection.HeaderFooter.Range.Paragraphs.Spa ceBefore = 0

objWRD.Selection.HeaderFooter.Range.Font.Name = "Arial"
objWRD.Selection.HeaderFooter.Range.Font.Size = 16
objWRD.Selection.HeaderFooter.Range.Text = "INTESTAZIONE - LINEA UNO"


objWRD.Selection.HeaderFooter.Range.Font.Name = "Tahoma"
objWRD.Selection.HeaderFooter.Range.Font.Italic = True
objWRD.Selection.HeaderFooter.Range.Font.Size = 14
objWRD.Selection.HeaderFooter.Range.InsertAfter "Intestazione - Liena Due"

objWRD.Selection.HeaderFooter.Range.Font.Name = "Times new Roman"
objWRD.Selection.HeaderFooter.Range.Font.Bold = True
objWRD.Selection.HeaderFooter.Range.Font.Size = 12
objWRD.Selection.HeaderFooter.Range.Text = "intestazione - linea tre"

objWRD.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

objWRD.Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify

Set objWRD = Nothing

End Sub
 

Discussioni simili