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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access / Word application creates (some) .WBK files

Status
Not open for further replies.

bradmaunsell

Programmer
May 8, 2001
156
US
This is about a problem with WORD docs being created from ACCESS and saved to the server.

Windows XP SP2 on all workstations
Server has Windows 2003

We have an Access application that creates Word documents, saves them on the server and writes hyperlinks to associate these Word docs with an insurance bound policy record.

This all work great when everything is running on my (development) laptop.

However, when running in our production directory on the server, some Word docs are created correctly and saved properly but we are finding some other Word docs named "Backup of NNNNN_FFFFFFFFFFF_YYYMMDD.WBK" are also being created.

I use this same code in another application for quoting and it has been running fine on the server for over a year.

I have no clues to why these WBK docs are being created.

The general flow is as follows:

On a datasheet styl form, there is a button "Create Word Doc"

Set variable to Word Template name

Create New Word Instance

Open the template and Polulate Word Doc

Use Select Case to call actaul document's Visual Basic to go to various Bookmarks in template (Uses this command: oWord.Documents.Add pathWordtemplates & "\" & strWordTemplateName, NewTemplate:=False, DocumentType:=0 )

Save the Word Docs on the server

Public Sub SaveWordDoc(strSaveAs As String, lngAppID As Long)
Dim strDate As String
Dim SaveDocPathAndName As String
If Left(strTemplateName, 5) <> "QUOTE" Then
strDate = Format(Now(), "yyyymmdd")
Else
strDate = Format(Now(), "yyyymmdd_HHMM")
End If
SaveDocPathAndName = strSaveAs & "_" & strDate
SaveDocPathAndName = pathSaveWordDocs & "\" & SaveDocPathAndName

oWord.ChangeFileOpenDirectory pathSaveWordDocs
oWord.ActiveDocument.SaveAs FileName:=SaveDocPathAndName, FileFormat:=wdFormatDocument, LockComments:=False, _
Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False

AppendDocumentHyperlink SaveDocPathAndName, lngAppID

End Sub


Close everthing up with this routine

If WordOpen = True Then
oWord.Application.Quit
Set oWord = Nothing
WordOpen = False
Err = 0
End If



As I mentioned before, this works great when run locally and the WBK file creations do not always occur.

Anybody have any ideas?

Thanks,
Brad
 
Try setting
Code:
oWord.Options.CreateBackup = False
When you create the new instance of Word
 
That did not work Golom.

Here is another clue.

The BKW files have a later creation time (same date).

The first set of Word documents are created by an insurance underwriter. Then, later on the same or any later date, another review person opens the original docs using the hyperlinks. That person updates some of the infor in these docs and then "SAVES" the doc.

The BKW seem to all be later dates suggesting the happened when the second person did a "manual save". However, there is no proof of this theory.

Brad

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top