By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,913 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,913 IT Pros & Developers. It's quick & easy.

Help with OLE object addition and size in a report

P: 2
I want to ask two question
{Admin edit - This is not acceptable}
when we are adding an OLE Object in a form:
1. can we directly by pressing the button add a word document not giving a choice dialog box
1 Week Ago #1
Share this Question
Share on Google+
4 Replies

Expert 5K+
P: 8,652
1. can we directly by pressing the button add a word document not giving a choice dialog box
Yes you can. As an example, to directly Embed the Word Document Test.docx into a Bound OLE Object Field on the Current Form, where Test.docx is in the same Folder as your DB:
Expand|Select|Wrap|Line Numbers
  1. With Me![txtOLE]
  2.   .Class = "Word.Document"
  3.   .OLETypeAllowed = acOLEEmbedded
  4.   .SourceDoc = CurrentProject.Path & "\Test.docx"
  5.   .Action = acOLECreateEmbed
  6. End With
P.S. - If I'm not mistaken, Access does not control the Printing of Embedded Objects, the Server Application that created them does. If you are interested in simply Printing the Embedded Objects, then there is a work-a-round. You can store them as Binary Objects in an OLE Object Field, extract them on demand to a Temporary Folder, then Print them using the ShellExecute() API Function. Obviously, this is more complex approach that would require changing any existing Code.
1 Week Ago #2

P: 2
This code works if the ole object is just 1 and fixed
but in my case I have an ole object for every record in the database which may be 200 per year
1 Week Ago #3

Expert 5K+
P: 8,652
Are you saying that you have to dynamically add 200 OLE Objects to 200 Records of your Database? If this is the case, then you can probably expect your DB to get rather large, rather quickly.
1 Week Ago #4

Expert Mod 15k+
P: 31,530
I'm too late for this one so I need to remind all experts that posting multiple questions in a single thread is, for what I consider very obvious reasons, unacceptable.

I will remove the latter two questions and suggest that Karem should post them in separate threads individually should they be interested in getting help for them.
1 Week Ago #5

Post your reply

Sign in to post your reply or Sign up for a free account.