Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unbound Object Frame - Source Doc

185 views
Skip to first unread message

Annette Massie

unread,
Sep 12, 2000, 2:20:55 PM9/12/00
to
In Access 97 I have a form that captures the path of a Word document. I
would like that Word document path to be the source doc of an Unbound Object
Frame.

Is there a way to do this in code?


Turtle MacDermott

unread,
Sep 12, 2000, 7:50:11 PM9/12/00
to
MyFrame.sourceDoc=WordPath
MyFrame.action=1

HTH
- Turtle

Annette Massie wrote in message ...

Turtle MacDermott

unread,
Sep 13, 2000, 3:00:00 AM9/13/00
to
When you create your unbound object frame, you have to put a "dummy" object
in it; it doesn't matter what you use, but I'd suggest something small.
And once it's created, you need to set its Enabled property to Yes and its
Locked property to No.

HTH
- Turtle

Annette Massie wrote in message

<#EN9oGYH...@cppssbbsa02.microsoft.com>...
>Thank you very much for your response!
>
>This is what I've done. In my report, I have inserted an unbound object
>frame. I create the file for the unbound object frame from a file and link
>it. So the file I used is then in the source doc property with its complete
>path name.The other properties are as follows:
>OLE Class: Microsoft Word 97
>OLE Type: Linked
>OLE Type Allowed: Either
>Class: Word.Document.8
>Source Doc: D:\MyStuff\Document1.doc
>
>I am capturing the path name via a form for report criteria because 1) I
>don't know if the user wants to move that WORD file somewhere else, and 2)
I
>have other selection criteria on the form that the user may need to use a
>different WORD document in the object frame than the one I created the
>object frame with.
>
>Therefore, I capture the path of the WORD document and it looks like
>D:\MyStuff\Document2.doc. (WordPath).Given this path I want to change the
>source doc of the object frame in the report to be this path.
>
>My unbound object frame is called OLEWord. I used your suggestion of
>OLEWord.sourcDoc = Forms!frmReportSelection!WordPath
>OLEWord.action=1
>
>I receive the following error:
>The bound or unbound object frame you tried to edit doesn't contain an OLE
>object.
>
>What am I doing wrong, missing or don't get?
>
>Thanks for your help!
>
>I receive the following error:
>"Turtle MacDermott" <macde...@mindspring.com> wrote in message
>news:8pmffo$ne9$1...@slb2.atl.mindspring.net...

Annette Massie

unread,
Sep 13, 2000, 8:54:30 AM9/13/00
to

Thanks for your help!

Annette Massie

unread,
Sep 14, 2000, 3:00:00 AM9/14/00
to
Thanks for the reply.

I think I am doing that already. To add the unbound object frame to the
detail section of my report, I click the Insert tab and select object. In
the Insert Object form, I select "Create from File" and then browse to find
one of the files and then I click "Link" to link to the file rather that
embedding it. Is this what you mean by having an object in the frame?

Then when I click OK, I see the WORD document in the object frame. Now this
WORD document is one of a few that may be in the report.

When I have the user enter the report criteria, I capture a file path of a
different WORD document, if selected by the user. I then want to use this
document as the "inserted" WORD document. I guess I was thinking that I
could change the "Sourcedoc" of the object to do this. When I use OLEWord
(name of unbound object frame) - OLEWord.sourcedoc =
Forms!RptCriteria!PathName am I referring to the object frame and not the
"inserted object"? - Is that why I receive the error?

I think I must be missing the obvious.


"Turtle MacDermott" <macde...@mindspring.com> wrote in message

news:8pp3m4$1tu$1...@slb2.atl.mindspring.net...


> When you create your unbound object frame, you have to put a "dummy"
object
> in it; it doesn't matter what you use, but I'd suggest something small.
> And once it's created, you need to set its Enabled property to Yes and its
> Locked property to No.
>

> HTH
> - Turtle
>
> Annette Massie wrote in message

> <#EN9oGYH...@cppssbbsa02.microsoft.com>...

Turtle MacDermott

unread,
Sep 14, 2000, 3:00:00 AM9/14/00
to
It all sounds good so far to me.
Did you set the Enabled property of OLEWord to Yes and the Locked property
to No?
(you can do this on the property sheet in Design view.)
Is Forms!RptCriteria!PathName a fully qualified file name (e.g. "C:\My
documents\MyWord.Doc")?

After this line:
OLEWord.sourcedoc =Forms!RptCriteria!PathName
did you use this one?
OLEWord.Action=1

HTH
- Turtle


Annette Massie wrote in message ...

>Thanks for the reply.
>
>I think I am doing that already. To add the unbound object frame to the
>detail section of my report, I click the Insert tab and select object. In
>the Insert Object form, I select "Create from File" and then browse to find
>one of the files and then I click "Link" to link to the file rather that
>embedding it. Is this what you mean by having an object in the frame?
>
>Then when I click OK, I see the WORD document in the object frame. Now this
>WORD document is one of a few that may be in the report.
>
>When I have the user enter the report criteria, I capture a file path of a
>different WORD document, if selected by the user. I then want to use this
>document as the "inserted" WORD document. I guess I was thinking that I
>could change the "Sourcedoc" of the object to do this. When I use OLEWord
>(name of unbound object frame) - OLEWord.sourcedoc =
>Forms!RptCriteria!PathName am I referring to the object frame and not the
>"inserted object"? - Is that why I receive the error?
>
>I think I must be missing the obvious.
>
>

>"Turtle MacDermott" <macde...@mindspring.com> wrote in message

>news:8pp3m4$1tu$1...@slb2.atl.mindspring.net...
>> When you create your unbound object frame, you have to put a "dummy"
>object
>> in it; it doesn't matter what you use, but I'd suggest something small.
>> And once it's created, you need to set its Enabled property to Yes and
its
>> Locked property to No.
>>

>> HTH
>> - Turtle
>>
>> Annette Massie wrote in message

>> <#EN9oGYH...@cppssbbsa02.microsoft.com>...

Annette Massie

unread,
Sep 15, 2000, 3:00:00 AM9/15/00
to
I can not set the enabled or locked property for OLEWord because they are
not available on the property sheet. Also, when I assign them in code, I get
the following error "You entered an expression that has an invalid reference
to the property locked".

I will check out the path name. I think it is as follows
C:\MyDocuments\MyWord.Doc (without quotation marks). I will add them and see
if that makes a difference.

Yes I am using OLEWord.Action=1 after assigning the path.

Any other suggestions? Why am I not getting the enable and locked
properties? When I look at the property sheet, I see the following:

OLE Class: Microsoft Word 97
OLE Type: Linked
OLE Type Allowed: Either
Class: Word.Document.8

Source Doc: C:\MyDocuments\MyWord.Doc

This is what I have in the OnFormat event of the Detail section of the
report. Should it be somewhere else?

OLEWord.Locked = False 'I receive an error here
OLEWord.Enabled = True 'I receive an error here too
OLEWord.OLETypeAllowed = acOLELinked
OLEWord.SourceDoc =
[Forms]![frmMenuReport]![fsfrRptOptions].[Form]![FilePath]
OLEWord.Action = acOLECreateLink


"Turtle MacDermott" <macde...@mindspring.com> wrote in message

news:8prl1l$uvl$1...@slb0.atl.mindspring.net...


> It all sounds good so far to me.
> Did you set the Enabled property of OLEWord to Yes and the Locked property
> to No?
> (you can do this on the property sheet in Design view.)
> Is Forms!RptCriteria!PathName a fully qualified file name (e.g. "C:\My
> documents\MyWord.Doc")?
>
> After this line:
> OLEWord.sourcedoc =Forms!RptCriteria!PathName
> did you use this one?
> OLEWord.Action=1
>

> HTH
> - Turtle
>
>
> Annette Massie wrote in message ...

> >Thanks for the reply.
> >
> >I think I am doing that already. To add the unbound object frame to the
> >detail section of my report, I click the Insert tab and select object. In
> >the Insert Object form, I select "Create from File" and then browse to
find
> >one of the files and then I click "Link" to link to the file rather that
> >embedding it. Is this what you mean by having an object in the frame?
> >
> >Then when I click OK, I see the WORD document in the object frame. Now
this
> >WORD document is one of a few that may be in the report.
> >
> >When I have the user enter the report criteria, I capture a file path of
a
> >different WORD document, if selected by the user. I then want to use this
> >document as the "inserted" WORD document. I guess I was thinking that I
> >could change the "Sourcedoc" of the object to do this. When I use OLEWord
> >(name of unbound object frame) - OLEWord.sourcedoc =
> >Forms!RptCriteria!PathName am I referring to the object frame and not the
> >"inserted object"? - Is that why I receive the error?
> >
> >I think I must be missing the obvious.
> >
> >

> >"Turtle MacDermott" <macde...@mindspring.com> wrote in message

> >news:8pp3m4$1tu$1...@slb2.atl.mindspring.net...
> >> When you create your unbound object frame, you have to put a "dummy"
> >object
> >> in it; it doesn't matter what you use, but I'd suggest something small.
> >> And once it's created, you need to set its Enabled property to Yes and
> its
> >> Locked property to No.
> >>

> >> HTH
> >> - Turtle
> >>
> >> Annette Massie wrote in message

> >> <#EN9oGYH...@cppssbbsa02.microsoft.com>...

Denis McMahon

unread,
Sep 15, 2000, 3:00:00 AM9/15/00
to
Annette Massie wrote:
>
> I can not set the enabled or locked property for OLEWord because they are
> not available on the property sheet. Also, when I assign them in code, I get
> the following error "You entered an expression that has an invalid reference
> to the property locked".
>
> I will check out the path name. I think it is as follows
> C:\MyDocuments\MyWord.Doc (without quotation marks). I will add them and see
> if that makes a difference.

Should there be a space in "My Documents"

Rgds
Denis

--
Denis McMahon Phone: +49 211 534 1073
Ericsson GmbH Email: denis....@edd.ericsson.se
Ericsson speaks for themselves, I speak for me. Don't get us confused.

Annette Massie

unread,
Sep 15, 2000, 3:00:00 AM9/15/00
to

As an aside, I checked out the enabled and locked properties for the unbound
object frame. It appears that those properties are only available in forms
and not reports. Is that correct?

"Turtle MacDermott" <macde...@mindspring.com> wrote in message

news:8prl1l$uvl$1...@slb0.atl.mindspring.net...
> It all sounds good so far to me.
> Did you set the Enabled property of OLEWord to Yes and the Locked property
> to No?
> (you can do this on the property sheet in Design view.)
> Is Forms!RptCriteria!PathName a fully qualified file name (e.g. "C:\My
> documents\MyWord.Doc")?
>
> After this line:
> OLEWord.sourcedoc =Forms!RptCriteria!PathName
> did you use this one?
> OLEWord.Action=1
>

> HTH
> - Turtle
>
>
> Annette Massie wrote in message ...

> >Thanks for the reply.
> >
> >I think I am doing that already. To add the unbound object frame to the
> >detail section of my report, I click the Insert tab and select object. In
> >the Insert Object form, I select "Create from File" and then browse to
find
> >one of the files and then I click "Link" to link to the file rather that
> >embedding it. Is this what you mean by having an object in the frame?
> >
> >Then when I click OK, I see the WORD document in the object frame. Now
this
> >WORD document is one of a few that may be in the report.
> >
> >When I have the user enter the report criteria, I capture a file path of
a
> >different WORD document, if selected by the user. I then want to use this
> >document as the "inserted" WORD document. I guess I was thinking that I
> >could change the "Sourcedoc" of the object to do this. When I use OLEWord
> >(name of unbound object frame) - OLEWord.sourcedoc =
> >Forms!RptCriteria!PathName am I referring to the object frame and not the
> >"inserted object"? - Is that why I receive the error?
> >
> >I think I must be missing the obvious.
> >
> >

> >"Turtle MacDermott" <macde...@mindspring.com> wrote in message

> >news:8pp3m4$1tu$1...@slb2.atl.mindspring.net...
> >> When you create your unbound object frame, you have to put a "dummy"
> >object
> >> in it; it doesn't matter what you use, but I'd suggest something small.
> >> And once it's created, you need to set its Enabled property to Yes and
> its
> >> Locked property to No.
> >>

> >> HTH
> >> - Turtle
> >>
> >> Annette Massie wrote in message

> >> <#EN9oGYH...@cppssbbsa02.microsoft.com>...

0 new messages