View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gérard Ducouret Gérard Ducouret is offline
external usenet poster
 
Posts: 15
Default How to write in Word w/o Reference

Hello,
I need to write data and symbols in a Word document, without any Reference
to Microsoft Word 11.0 because another application is disturbed by such a
reference. So I tried the folowing macro, but the wdAlignParagraphCenter
and .Color = wdColorRed don't work until I reset the reference.
What can I do ?
Thanks for your help.

Gérard

Public Sub CALL_WORD()
Dim wrdApp As Object
Dim wrdDoc As Object
Dim MyTable4 As Object

Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True

Set wrdDoc = wrdApp.Documents.Open(FileName:="D:\Mes
documents\Pilotage\Fiche Pilotage 3 WPs V2.doc")

Set MyTable4 = wrdDoc.Tables(4)
MyTable4.Cell(Row:=4, Column:=11).Range.Text = Chr(236) 'Chr(236)
'Flèche ascendante
MyTable4.Cell(Row:=4, Column:=11).Range.Select
wrdDoc.Application.Selection.ParagraphFormat.Align ment =
wdAlignParagraphCenter 'Doesn't work!!!

With wrdDoc.Application.Selection.Font
.Name = "Wingdings"
.Size = 16
.Bold = True
.Color = wdColorRed ''Doesn't work!!!
End With

wrdDoc.Close SaveChanges:=True
wrdApp.Quit
Set wrdApp = Nothing
Set wrdDoc = Nothing

End Sub