S
snaggy^^
I need to create a vba macro in access 2007 that opens a word 2007 document,
fills in the correct data from an access record (just one, not recursive) and
print it out.
I thought to open a document with symbols where I want to fill in data (like
<<1>> <<2>> etc), and the use find and replace to do it.
here's what I wrote:
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open ("c:\Liquid\template.docx")
objWord.Visible = True
With objWord
..Selection.Find.ClearFormatting
.Selection.Find.Replacement.ClearFormatting
With .Selection.Find
.Text = "<<1>>"
.Replacement.Text = "something"
.MatchCase = True
End With
.Selection.Find.Execute Replace:=wdReplaceAll
End With
it does open the file and select the first occurrence to replace, but then
nothing happens!
Why?
bye and thank you all
fills in the correct data from an access record (just one, not recursive) and
print it out.
I thought to open a document with symbols where I want to fill in data (like
<<1>> <<2>> etc), and the use find and replace to do it.
here's what I wrote:
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open ("c:\Liquid\template.docx")
objWord.Visible = True
With objWord
..Selection.Find.ClearFormatting
.Selection.Find.Replacement.ClearFormatting
With .Selection.Find
.Text = "<<1>>"
.Replacement.Text = "something"
.MatchCase = True
End With
.Selection.Find.Execute Replace:=wdReplaceAll
End With
it does open the file and select the first occurrence to replace, but then
nothing happens!
Why?
bye and thank you all