Tried to set a signature but this option has yet to be made available to me?? So have added one below
Okay this is my code...
My question is what is the difference as syntactically they seem to be equivalent functionally!! I have obviously got something wrong in my understanding of the model. Please help
Gus
@@@ BEWARE Newbie to Excel VBA @@@
Excel VBA 2003
Brace yourselves for lots of stupid questions !!!
Okay this is my code...
Code:
Sub makeAmemo()
Dim myWordDoc As Word.Application
Set myWordDoc = New Word.Application
Dim myString As String
Dim SaveAsName As String
'
SaveAsName = ThisWorkbook.Path & "\Donkey.doc"
For i = 1 To WorksheetFunction.CountA(ThisWorkbook.Sheets("sheet1").Range("A:A"))
myString = ThisWorkbook.Sheets("sheet1").Cells(i, 1)
[B]
'THIS DOES NOT WORK
' myWordDoc.Documents.Add.Selection.Font.Size = 14
' myWordDoc.Documents.Add.Selection.TypeText Text:=" I am Here "
' myWordDoc.Documents.Add.Selection.TypeText Text:=Format(Time, "hh:nn:ss dd mmm yyyy")
' myWordDoc.ActiveDocument.SaveAs Filename:=SaveAsName
'BUT THIS DOES[/B]
With myWordDoc
.Documents.Add
With .Selection
.Font.Size = 14
.TypeText Text:=" I am Here Also "
.TypeText Text:=Format(Time, "hh:nn:ss dd mmm yyyy")
End With
.ActiveDocument.SaveAs Filename:=SaveAsName
End With
Next i
End Sub
My question is what is the difference as syntactically they seem to be equivalent functionally!! I have obviously got something wrong in my understanding of the model. Please help
Gus
@@@ BEWARE Newbie to Excel VBA @@@
Excel VBA 2003
Brace yourselves for lots of stupid questions !!!