M
Miguel
Hi,
I 've a table with linked OLE objects.
Now I moved the files to another location.
How can I tell my ms-access 2000 db to change all location of ole objects
in my table.
I tried following code, but it doesn't seem to work.
acOLEUpdate doesn't seems to work as I expeted.
And this code still requires to open WORD :-(
"
'
Sub tst()
Dim frmName As String, fldName As String, replName As String
Dim frm As Form
Dim rsTbl As Recordset
Dim wrd1 As Object
'fill in some names...
DoCmd.OpenForm frmName
Set frm = Forms(frmName)
Set rsTbl = frm.RecordsetClone
rsTbl.MoveFirst
'start loop here
'sync form with recordset
frm.Bookmark = rsTbl.Bookmark
With frm(fldName).Object
.Action = acOLEActivate
Set wrd1 = GetObject(, "Word.Application")
rsTbl.Edit
'.Class = "Word.Document"
.OLETypeAllowed = acOLELinked
.SourceDoc = replName ' new doc name
.Action = acOLEUpdate ' try to update link to my doc
rsTbl.Update
End With
rsTbl.MoveNext
'end loop
End Sub
"
Any help would be appreciated.
Thanks,
Miguel
I 've a table with linked OLE objects.
Now I moved the files to another location.
How can I tell my ms-access 2000 db to change all location of ole objects
in my table.
I tried following code, but it doesn't seem to work.
acOLEUpdate doesn't seems to work as I expeted.
And this code still requires to open WORD :-(
"
'
Sub tst()
Dim frmName As String, fldName As String, replName As String
Dim frm As Form
Dim rsTbl As Recordset
Dim wrd1 As Object
'fill in some names...
DoCmd.OpenForm frmName
Set frm = Forms(frmName)
Set rsTbl = frm.RecordsetClone
rsTbl.MoveFirst
'start loop here
'sync form with recordset
frm.Bookmark = rsTbl.Bookmark
With frm(fldName).Object
.Action = acOLEActivate
Set wrd1 = GetObject(, "Word.Application")
rsTbl.Edit
'.Class = "Word.Document"
.OLETypeAllowed = acOLELinked
.SourceDoc = replName ' new doc name
.Action = acOLEUpdate ' try to update link to my doc
rsTbl.Update
End With
rsTbl.MoveNext
'end loop
End Sub
"
Any help would be appreciated.
Thanks,
Miguel