In my Access Application using an ADP file, the user clicks on a report line titled IRA from a list box which is associated with a field value qryIRAFall.
If the user selects this IRA report record from the listbox, then the paragraph IRAQueryFall gets executed in my Access application. This
IRAQueryFall() paragraph executes the VBA code to open the Word document C:/UDL/Second Notice.htm of type HTML as follows:
Private Sub cmdCustRpts_Click()
For Each vnt In lstCustRpts.ItemsSelected
strQuery = lstCustRpts.Column(1, vnt)
If (strQuery = "qryCuPFQ") Then
FallQueryACSToExcel
ElseIf (strQuery = "qryIRAFall") Then
IRAQueryFall
End If
Next vnt
ClearCustRptStrings
DoCmd.Hourglass False
End Sub
Private Sub IRAQueryFall()
Dim wdApp As Word.Application
Dim doc As Word.Document
Dim strFile As String
strFile = "C:/UDL/Second Notice.htm"
Set wdApp = CreateObject("Word.Application")
wdApp.Visible = True
AppActivate "Microsoft Word"
If Dir$(strFile) <> "" Then
Set doc = wdApp.Documents.Open(strFile)
doc.Saved = False
End If
End Sub
Here is my problem:
If I modify a Word Document named C:/UDL/Second Notice.htm and click on the Save Icon before closing the Word application, the html type file is saved correctly to C:/UDL/Second Notice.htm
However, if I modify this Word Document and then close the Word Application (without clicking on the Save Icon), a dialog box appears
and poses the following question:
-----------------------------------------------------------
Do you want to save the changes to "Second Notice" ?
Yes No Cancel
-----------------------------------------------------------
If I click on the Yes option, then the SAVE takes effect but the file name that is written to is named "Second%20Notice.htm".
Then, the next time that the Word Application is launched, the file that is opened is the file named "Second Notice.htm" which doesn't reflect the changes
which were saved in "Second%20Notice.htm".
How can I resolve this discrepancy in file names of
1) "Second%20Notice.htm". (created by closing the Word document (without Saving the file) and answering Yes to the system generated question:
Do you want to save the changes to "Second Notice" ?
vs.
2) "Second Notice.htm" (created by clicking on the Save Icon within the Word Application).
If the user selects this IRA report record from the listbox, then the paragraph IRAQueryFall gets executed in my Access application. This
IRAQueryFall() paragraph executes the VBA code to open the Word document C:/UDL/Second Notice.htm of type HTML as follows:
Private Sub cmdCustRpts_Click()
For Each vnt In lstCustRpts.ItemsSelected
strQuery = lstCustRpts.Column(1, vnt)
If (strQuery = "qryCuPFQ") Then
FallQueryACSToExcel
ElseIf (strQuery = "qryIRAFall") Then
IRAQueryFall
End If
Next vnt
ClearCustRptStrings
DoCmd.Hourglass False
End Sub
Private Sub IRAQueryFall()
Dim wdApp As Word.Application
Dim doc As Word.Document
Dim strFile As String
strFile = "C:/UDL/Second Notice.htm"
Set wdApp = CreateObject("Word.Application")
wdApp.Visible = True
AppActivate "Microsoft Word"
If Dir$(strFile) <> "" Then
Set doc = wdApp.Documents.Open(strFile)
doc.Saved = False
End If
End Sub
Here is my problem:
If I modify a Word Document named C:/UDL/Second Notice.htm and click on the Save Icon before closing the Word application, the html type file is saved correctly to C:/UDL/Second Notice.htm
However, if I modify this Word Document and then close the Word Application (without clicking on the Save Icon), a dialog box appears
and poses the following question:
-----------------------------------------------------------
Do you want to save the changes to "Second Notice" ?
Yes No Cancel
-----------------------------------------------------------
If I click on the Yes option, then the SAVE takes effect but the file name that is written to is named "Second%20Notice.htm".
Then, the next time that the Word Application is launched, the file that is opened is the file named "Second Notice.htm" which doesn't reflect the changes
which were saved in "Second%20Notice.htm".
How can I resolve this discrepancy in file names of
1) "Second%20Notice.htm". (created by closing the Word document (without Saving the file) and answering Yes to the system generated question:
Do you want to save the changes to "Second Notice" ?
vs.
2) "Second Notice.htm" (created by clicking on the Save Icon within the Word Application).