How to link a file stored in OneDrive to an Bound Object Frame Control in Access
Hi,
first of all I'm sorry if I return on a problem I had already signaled, but now I have more details.
This is a very small Access 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 "E:\OneDrive\Documenti.... 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 "https://d.docs.live.net/2ae.../Documenti.... then Error 2101 (setting non valid for this property) [or similar]
I hope is there a solution.
I don't want to obblige the user
- to save the files outside OneDrive folder
- neither to abandon the synchronization of the 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 a show in an Access form a Word file saved on the cloud?
Thank you very much for every suggestion.
Lauro