Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar in Access while saving output file

Status
Not open for further replies.

leslie746

MIS
May 31, 2004
28
GB
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.
 
Take a look at the Application.SysCmd method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top