T
Tammy
I am trying to set the properties of an embedded object
using visual basic. When I run the code, get a runtime
error #2101, which states "the setting you entered isn't
valid for this property". Here is the code I am using:
strName = Me![SOP Name] & ".doc"
strAuthor = Me![Author]
strDate = Me![Date Written]
strRevision = Me![Revision No]
strPath = "C:\Documents and
Settings\Owner\Application Data\Microsoft\Templates\"
strTemp = "SOP.dot"
strDoc = "C:\SavedSOPs\" & strName
Me![oleDocument].Class = "Word.Document"
Me![oleDocument].Action = acOLECreateEmbed
Me![oleDocument].SourceDoc = strDoc
Me![oleDocument].Action = acOLEActivate
I get the error message on the .sourcedoc line. I am
trying to code it this way because the document will
change everytime, so I cannot hardcode that information.
Another "weird" thing that is happening, is that I am
getting an error message form visual C++ when I try to
close the form stating that there was "abnormal
termination" - I believe it state 'application' within
there somewhere. It also displays the path
to "winword.exe". So, it would appear that word is being
opened - I think! But, I cannot see it - not even when I
do the "ctrl/alt/del" - before closing the form. I have
the "activate" command in there, by the way, so that the
user is able to edit the doc (this is a new doc also, in
case that makes a difference!).
I'm so confused! I am on a tight schedule here, if you
have any ideas, or any helpful resources, please let me
know!
THANKS
using visual basic. When I run the code, get a runtime
error #2101, which states "the setting you entered isn't
valid for this property". Here is the code I am using:
strName = Me![SOP Name] & ".doc"
strAuthor = Me![Author]
strDate = Me![Date Written]
strRevision = Me![Revision No]
strPath = "C:\Documents and
Settings\Owner\Application Data\Microsoft\Templates\"
strTemp = "SOP.dot"
strDoc = "C:\SavedSOPs\" & strName
Me![oleDocument].Class = "Word.Document"
Me![oleDocument].Action = acOLECreateEmbed
Me![oleDocument].SourceDoc = strDoc
Me![oleDocument].Action = acOLEActivate
I get the error message on the .sourcedoc line. I am
trying to code it this way because the document will
change everytime, so I cannot hardcode that information.
Another "weird" thing that is happening, is that I am
getting an error message form visual C++ when I try to
close the form stating that there was "abnormal
termination" - I believe it state 'application' within
there somewhere. It also displays the path
to "winword.exe". So, it would appear that word is being
opened - I think! But, I cannot see it - not even when I
do the "ctrl/alt/del" - before closing the form. I have
the "activate" command in there, by the way, so that the
user is able to edit the doc (this is a new doc also, in
case that makes a difference!).
I'm so confused! I am on a tight schedule here, if you
have any ideas, or any helpful resources, please let me
know!
THANKS