I found some code to create a Word doc from VB6 and that works OK.
Could not set DocumentProperty in DocumentProperties collection, so created
a Macro in Word and copied the macro into my VB6 program. That method
helps a lot in Excel. But nothing of the Word macro works in VB6.
???????
Private oWord As Object
Private oDoc As Object
Private Sub Form_Load()
Set oWord = CreateObject("word.application")
Set oDoc = oWord.documents.Add()
oDoc.Activate
'I can debug print the oDoc name - it is Document1 ...
With oDoc.Styles(wdStyleNormal).Font 'Fails
If .NameFarEast = .NameAscii Then
.NameAscii = ""
End If
.NameFarEast = ""
End With
With oDoc.PageSetup
' TopMargin = oDoc.InchesToPoints(0.4)
'above failed. obj d/not support prop or meth
Am I the only one on the planet for whom MS object model don't seem to work?
Thank you for kind help.
Archived from group: microsoft>public>vb>ole>automation