I am trying to do the following:
1. Loop through a table of embeded Word docs
2. Open each one
3. Save it as a file
4. Close the file
5. Loop to the next one
Here is my looping and opening code that is not working.
I get an Object 424 required, then a type 13 mismatch.
My questions are these?
1. Is my loop correct?
2. Am I oepning the Word file correctly? Am I setting the control correctly?
3. Any ideas on how to save the file out passing the name to save?
1. Loop through a table of embeded Word docs
2. Open each one
3. Save it as a file
4. Close the file
5. Loop to the next one
Here is my looping and opening code that is not working.
Code:
Dim rst As New ADODB.Recordset
Dim strTableName As String
Dim ctl As Control
strTableName = "T_EmbededDocs"
Set rst = CurrentDb.OpenRecordset(strTableName)
Do While Not rst.EOF
Set ctl = rst.Fields("DocEmbeded") '.Value
With ctl
.Verb = acOLEVerbShow
' Activate object.
.Action = acOLEActivate
End With
rst.MoveNext
Loop
I get an Object 424 required, then a type 13 mismatch.
My questions are these?
1. Is my loop correct?
2. Am I oepning the Word file correctly? Am I setting the control correctly?
3. Any ideas on how to save the file out passing the name to save?