Hi,
I have a problem linking a Word file as an OLE object inside an Access Table/Form, if it is saved inside a OneDrive Folder.
In the attachement there is a small database to simulate the problem.
You should try to put this Access file inside and outside a OneDrive folder to fully understand the problem.
Inside the database there is a table tblFiles with a field for OLE Objects (Word documents); and the related form frmFiles with a Bound Object Frame control for those OLE Objects.
When you click the addRecord in the footer of the frmFiles a new Word file is created; something is written in its content and the only 3 fields of a new record are filled with the Name, FullName and OLE Object of the newly created file.
To link the file I used the following code, where BOFC is the Bound Object Frame control and the string sFullFileName is obtained or joining the path of the Access file with the name of the Word file or taking the FullName property of the Word file.
with BOFC
.Class = "Word.Document"
.OLETypeAllowed = acOLELinked
.SourceDoc = sFullFileName
.Action = acOLECreateLink
end with
If the files are saved outside OneDrive Folders everything works as supposed.
If the file are saved INSIDE a OneDrive Folder there could be one of the following two problems:
I don't want to obblige the user
to save the files outside OneDrive folder
neither to abandon the sync of Office files with One Drive
The SourceDoc property of a Bound Object Frame control has always to be a local path?
There are other ways to link and show a Word file saved on the cloud in an Access form?
No problems with Google Drive or Dropbox
Thank you very much for every suggestion.
Lauro
I have a problem linking a Word file as an OLE object inside an Access Table/Form, if it is saved inside a OneDrive Folder.
In the attachement there is a small database to simulate the problem.
You should try to put this Access file inside and outside a OneDrive folder to fully understand the problem.
Inside the database there is a table tblFiles with a field for OLE Objects (Word documents); and the related form frmFiles with a Bound Object Frame control for those OLE Objects.
When you click the addRecord in the footer of the frmFiles a new Word file is created; something is written in its content and the only 3 fields of a new record are filled with the Name, FullName and OLE Object of the newly created file.
To link the file I used the following code, where BOFC is the Bound Object Frame control and the string sFullFileName is obtained or joining the path of the Access file with the name of the Word file or taking the FullName property of the Word file.
with BOFC
.Class = "Word.Document"
.OLETypeAllowed = acOLELinked
.SourceDoc = sFullFileName
.Action = acOLECreateLink
end with
If the files are saved outside OneDrive Folders everything works as supposed.
If the file are saved INSIDE a OneDrive Folder there could be one of the following two problems:
- If sFullFileName is the local path then Error 2737 (Impossible to found the file containing the OLE object linked that you try ti update through the comand link OLE/DDE) [or something similar, mine is in Italian]
- If sFullFileName is the cloud path then Error 2101 (setting non valid for this property) [or similar]
I don't want to obblige the user
to save the files outside OneDrive folder
neither to abandon the sync of Office files with One Drive
The SourceDoc property of a Bound Object Frame control has always to be a local path?
There are other ways to link and show a Word file saved on the cloud in an Access form?
No problems with Google Drive or Dropbox
Thank you very much for every suggestion.
Lauro
Attachments
Last edited: