Can anybody provide me with the coding for implementation of Progress Bar in Access to show the progress of the
command:
-------------------------------------------------
objWordDoc.SaveAs FileName:="YourDocName.doc"
---------------------------------------------------
in the following coding (courtesy of HTH Lightning and PHV):
'Open Word, import the text to the bookmarks and display the letter
Set objWord = New Word.Application
objWord.Visible = True
'Open Your Recordset and move to the first record
Set DB = CurrentDb
Set Rs = Db.OpenRecordset (“YourRecordset”, DbOpenDynaset)
Rs.MoveFirst
'Loop through each record of the Rs, inserting each field of the record into a Bookmark in the template
Do Until Rs.EOF
Set objWordDoc = objWord.Documents.Add(Template:="PathToTemplate\TemplateName.dot", NewTemplate:=False)
With objWordDoc.Bookmarks
.Item("Bookmark1").Range.Text = Rs.Fields(1)
.Item("Bookmark2").Range.Text = Rs.Fields(2)
etc
End With
'Save the letter to the desired folder
objWordDoc.SaveAs FileName:="YourDocName.doc"
objWordDoc.Close
Set objWordDoc = Nothing
Rs.MoveNext
Loop
objWord.Quit
Set objWord = Nothing
--------------------------------
Early response shall be most appreciated.
command:
-------------------------------------------------
objWordDoc.SaveAs FileName:="YourDocName.doc"
---------------------------------------------------
in the following coding (courtesy of HTH Lightning and PHV):
'Open Word, import the text to the bookmarks and display the letter
Set objWord = New Word.Application
objWord.Visible = True
'Open Your Recordset and move to the first record
Set DB = CurrentDb
Set Rs = Db.OpenRecordset (“YourRecordset”, DbOpenDynaset)
Rs.MoveFirst
'Loop through each record of the Rs, inserting each field of the record into a Bookmark in the template
Do Until Rs.EOF
Set objWordDoc = objWord.Documents.Add(Template:="PathToTemplate\TemplateName.dot", NewTemplate:=False)
With objWordDoc.Bookmarks
.Item("Bookmark1").Range.Text = Rs.Fields(1)
.Item("Bookmark2").Range.Text = Rs.Fields(2)
etc
End With
'Save the letter to the desired folder
objWordDoc.SaveAs FileName:="YourDocName.doc"
objWordDoc.Close
Set objWordDoc = Nothing
Rs.MoveNext
Loop
objWord.Quit
Set objWord = Nothing
--------------------------------
Early response shall be most appreciated.