473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

HELP!: "Object doesn't support this property or method"

I have been fighting with this for days and your expert help is
needed! Below is the code I am executing which results with "Object
doesn't support this property or method". The error is occuring on
the "With Me.OLEObject" line (By the way, I haven't found
documentation which explains what the "With" clause is suppose to
do?). I am trying to extract a Word document(OLE object) from an
Access database, for each record in the table, and save it as a Word
Document. The 4th field of each record is a OLE object type.

This is a continuation of my recent post "Exporting/Extracting an
Access OLE object (Word document) to a Word document file" in several
newsgroups.

Thank you for your help!

My Code:

dim conn
set conn = CreateObject("ADODB.Connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data
source=C:\work\srvScripts.mdb"

dim rs
dim NewDoc
set rs = CreateObject("ADODB.Recordset")
'rs.Open "select * from tblTemp", conn
rs.Open "tblTemp", conn

'rs.BOF and rs.EOF = True means that there is no records

rs.MoveFirst
while not rs.EOF
set srv = rs.Fields(1)
set ttl = rs.Fields(2)
NewDoc = "c:\tst\" & srv & "." & date() & "." & ttl & ".doc"
' WScript.Echo NewDoc
With Me.OLEObject
.Class = "Word.Document"
.Verb = acOLEVerbOpen
.Action = acOLEActivate
.Object.Application.Documents.Item(1).SaveAs NewDoc
.Object.Application.Quit
.Action = acOLEClose
End With

rs.MoveNext
wend
Nov 13 '05 #1
4 14100
"Otis Hunter" <ju*******@yahoo.com> wrote...
With Me.OLEObject


The problem is that forms and reports, there is no such prop? If there were
it would likely be an Object type, so you should dim a variable of the
right type and then assign it, rather than relying on With to do the work,
as that will take longer.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.

Nov 13 '05 #2
Any chance you, or anyone else, could show me an example of what you
are talking about or any other solution (I am 1 week new with VBScript
and fairly new to the windows OS)? Any example code will be greatly
appreciated!!!

Respectfully,

O

"Michael \(michka\) Kaplan [MS]" <mi*****@online.microsoft.com> wrote in message news:<40********@news.microsoft.com>...
"Otis Hunter" <ju*******@yahoo.com> wrote...
With Me.OLEObject


The problem is that forms and reports, there is no such prop? If there were
it would likely be an Object type, so you should dim a variable of the
right type and then assign it, rather than relying on With to do the work,
as that will take longer.

Nov 13 '05 #3
???

"Otis Hunter" <ju*******@yahoo.com> wrote in message
news:2a**************************@posting.google.c om...
I have been fighting with this for days and your expert help is
needed! Below is the code I am executing which results with "Object
doesn't support this property or method". The error is occuring on
the "With Me.OLEObject" line (By the way, I haven't found
documentation which explains what the "With" clause is suppose to
do?). I am trying to extract a Word document(OLE object) from an
Access database, for each record in the table, and save it as a Word
Document. The 4th field of each record is a OLE object type.

This is a continuation of my recent post "Exporting/Extracting an
Access OLE object (Word document) to a Word document file" in several
newsgroups.

Thank you for your help!

My Code:

dim conn
set conn = CreateObject("ADODB.Connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data
source=C:\work\srvScripts.mdb"

dim rs
dim NewDoc
set rs = CreateObject("ADODB.Recordset")
'rs.Open "select * from tblTemp", conn
rs.Open "tblTemp", conn

'rs.BOF and rs.EOF = True means that there is no records

rs.MoveFirst
while not rs.EOF
set srv = rs.Fields(1)
set ttl = rs.Fields(2)
NewDoc = "c:\tst\" & srv & "." & date() & "." & ttl & ".doc"
' WScript.Echo NewDoc
With Me.OLEObject
.Class = "Word.Document"
.Verb = acOLEVerbOpen
.Action = acOLEActivate
.Object.Application.Documents.Item(1).SaveAs NewDoc
.Object.Application.Quit
.Action = acOLEClose
End With

rs.MoveNext
wend

Nov 13 '05 #4
???

"Otis Hunter" <ju*******@yahoo.com> wrote in message
news:2a**************************@posting.google.c om...
I have been fighting with this for days and your expert help is
needed! Below is the code I am executing which results with "Object
doesn't support this property or method". The error is occuring on
the "With Me.OLEObject" line (By the way, I haven't found
documentation which explains what the "With" clause is suppose to
do?). I am trying to extract a Word document(OLE object) from an
Access database, for each record in the table, and save it as a Word
Document. The 4th field of each record is a OLE object type.

This is a continuation of my recent post "Exporting/Extracting an
Access OLE object (Word document) to a Word document file" in several
newsgroups.

Thank you for your help!

My Code:

dim conn
set conn = CreateObject("ADODB.Connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data
source=C:\work\srvScripts.mdb"

dim rs
dim NewDoc
set rs = CreateObject("ADODB.Recordset")
'rs.Open "select * from tblTemp", conn
rs.Open "tblTemp", conn

'rs.BOF and rs.EOF = True means that there is no records

rs.MoveFirst
while not rs.EOF
set srv = rs.Fields(1)
set ttl = rs.Fields(2)
NewDoc = "c:\tst\" & srv & "." & date() & "." & ttl & ".doc"
' WScript.Echo NewDoc
With Me.OLEObject
.Class = "Word.Document"
.Verb = acOLEVerbOpen
.Action = acOLEActivate
.Object.Application.Documents.Item(1).SaveAs NewDoc
.Object.Application.Quit
.Action = acOLEClose
End With

rs.MoveNext
wend

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ivan divandelen | last post by:
I wrote the code for Members of Register. and i use cookie in this code, My database is SQL server. SQL server dosent support the cookies in my codes i dont know why this cause but my codes are...
0
by: TOD | last post by:
We installed .NET 1.1 SP 1.0, and as a result the Description tag on the webservice does not support HTML tags anymore so we cannot insert any external documentation links? Is this meant to happen...
1
by: PAUL MITCHELL | last post by:
Hello, bit of strange one this, I have a VB .net application that has Sub Main() as its startup procedure, this then creates and shows a form. Up till now when I pressed F5 the form would duly...
9
by: Bremanand | last post by:
Hi... i need the solution of Why C# doesnt support Multiple inheritance???? Let me know the solution plz.. Thanks&Regards, Bremanand.S
0
by: Jack Wu | last post by:
Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please...
2
by: Charles | last post by:
I have a validation script used before submitting a form. When executed it says "Object doesn't support property or method". I'm using onclick="return validate();" which should be fine. But when...
0
by: =?Utf-8?B?RmFsZ3VuaSBWYWhvcmE=?= | last post by:
I have migrated the development environment for MFC single document application from VC 6 to VS 2005. I am not able to invoke the help file from the Menu – help . CMainFrame has the following...
3
by: callre | last post by:
when i used javascript onchange() the error is coming "object doesnt support this property" my code is- <script type='text/javascript' language="javascript"> function change() { ...
0
acoder
by: acoder | last post by:
Problem When setting the FORM object's action property an "Object does not support this property or method" error occurs Browser Internet Explorer 6- Example The Javascript code: var...
4
by: Zahir Malik | last post by:
Hi Guys I am having an wearied issue and need your expert opinions on this. I am not network geek so may be that is why in trouble. Here is the issue: We have an web application running on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.