Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Add DocumentType:=wdNewBlankDocument
'Activate document for typing
oApp.Activate
Do While Not rs.EOF
oApp.Selection.InsertFile _
FileName:=CStr(rs!FileName), Range:=""
rs.MoveNext
Loop
'Release reference
Set oApp = Nothing
Dim oApp as Object
Dim rs As DAO.Recordset
'Set up incidence of Word
Set oApp = CreateObject("Word.Application")
'And make it visible
oApp.Visible = True
'Add a blank document to Word
oApp.Documents.Add DocumentType:=wdNewBlankDocument
'Activate document for typing
oApp.Activate
'I have called the field with the location of files to
'insert FileName and the table tblFiles. You must change
'these names to match your table and field.
Set rs = CurrentDB.OpenRecordset ("Select FileName From tblFiles")
'Loop through the file inserting files, one before
'the next.
'It is assumed that FileName has the full address of
'the file to be inserted.
Do While Not rs.EOF
oApp.Selection.InsertFile _
FileName:=CStr(rs!FileName), Range:=""
rs.MoveNext
Loop
'Release reference
Set oApp = Nothing
rs.Close
Set rs=Nothing
On Error GoTo ErrorHandler
<...>
Set appWord = GetObject(, "Word.Application")
<...>
ErrorHandler:
If Err = 429 Then
'Word is not running; open Word with CreateObject
Set appWord = CreateObject("Word.Application")
Resume Next
Else
' MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description
' Resume ErrorHandlerExit
Resume Next
End If