Hello,
I posted yesterday the same problem, but now I want to be
more specific about it.
My intention is to create a windows service to process
some Word documents. If I use CreateObject to create a
reference to a Word object everything is working fine.
If I use GetObject to get a reference to Word object (of
course that Word applicaton is started) I get an error
("Cannot create ActiveX component")
It is like my service cannot detect that Word application
is started.
I want to say that GetObject is working fine from a
standard Windows application.
Thank you,
Andrei 5 6356
"Andrei" <pr**********@h otmail.com> wrote in news:003b01c377 0f$d95a89b0
$a*******@phx.g bl: Hello,
I posted yesterday the same problem, but now I want to be more specific about it.
My intention is to create a windows service to process some Word documents. If I use CreateObject to create a reference to a Word object everything is working fine.
If I use GetObject to get a reference to Word object (of course that Word applicaton is started) I get an error ("Cannot create ActiveX component")
It is like my service cannot detect that Word application is started.
I want to say that GetObject is working fine from a standard Windows application.
Thank you, Andrei
I'm unclear as to what is working and what is not for you? Are you
saying GetObject() works for getting the reference to the application,
but not other classes inside the application? Getobject() is only for
getting a reference to the application. You don't use it to get a
Document class instance. instead use the Documents property of the
Application instance!
Here is the code I use to get a reference to an application object in
AutoCAD. This should be very similar for a Word application:
mcadApplication = (AutoCAD.AcadAp plicationClass)
Marshal.GetActi veObject("AutoC AD.Application" );
It works similarly to GetObject.
--
Michael Lang, MCSD
Hi Michael,
Thank you for your reply. I will try to be more clear.
GetObject is returning me an error when I try to get a
reference to the Word application. But this is happening
only in windows services, in a standard windows
application I have no error.
CreateObject is working fine in both cases (windows
services or windows applications)
My question is why I cannot use GetObject in a windows
sevice?
Thank you,
Andrei -----Original Message----- "Andrei" <pr**********@h otmail.com> wrote in
news:003b01c377 0f$d95a89b0$a*******@phx. gbl:
Hello,
I posted yesterday the same problem, but now I want to
be more specific about it.
My intention is to create a windows service to process some Word documents. If I use CreateObject to create a reference to a Word object everything is working fine.
If I use GetObject to get a reference to Word object
(of course that Word applicaton is started) I get an error ("Cannot create ActiveX component")
It is like my service cannot detect that Word
application is started.
I want to say that GetObject is working fine from a standard Windows application.
Thank you, Andrei
I'm unclear as to what is working and what is not for
you? Are yousaying GetObject() works for getting the reference to the
application,but not other classes inside the application? Getobject
() is only forgetting a reference to the application. You don't use it
to get aDocument class instance. instead use the Documents
property of theApplication instance!
Here is the code I use to get a reference to an
application object inAutoCAD. This should be very similar for a Word
application: mcadApplicatio n = (AutoCAD.AcadAp plicationClass) Marshal.GetActi veObject("AutoC AD.Application" );
It works similarly to GetObject.
-- Michael Lang, MCSD
.
Hi Michael,
I have tried using Marshal.GetActi veObject instead of
GetObject as you suggested. I got an error : "Operation
unavailable"
Andrei, -----Original Message----- "Andrei" <pr**********@h otmail.com> wrote in
news:003b01c377 0f$d95a89b0$a*******@phx. gbl:
Hello,
I posted yesterday the same problem, but now I want to
be more specific about it.
My intention is to create a windows service to process some Word documents. If I use CreateObject to create a reference to a Word object everything is working fine.
If I use GetObject to get a reference to Word object
(of course that Word applicaton is started) I get an error ("Cannot create ActiveX component")
It is like my service cannot detect that Word
application is started.
I want to say that GetObject is working fine from a standard Windows application.
Thank you, Andrei
I'm unclear as to what is working and what is not for
you? Are yousaying GetObject() works for getting the reference to the
application,but not other classes inside the application? Getobject
() is only forgetting a reference to the application. You don't use it
to get aDocument class instance. instead use the Documents
property of theApplication instance!
Here is the code I use to get a reference to an
application object inAutoCAD. This should be very similar for a Word
application: mcadApplicatio n = (AutoCAD.AcadAp plicationClass) Marshal.GetActi veObject("AutoC AD.Application" );
It works similarly to GetObject.
-- Michael Lang, MCSD
.
"Andrei" <pr**********@h otmail.com> wrote in news:042b01c377 16$38e01020
$a*******@phx.g bl: Hi Michael,
I have tried using Marshal.GetActi veObject instead of GetObject as you suggested. I got an error : "Operation unavailable"
Andrei,
Sorry, I've never made a Windows Service. I don't know why it would work
on Windows Forms and not a Windows Service?
--
Michael Lang, MCSD
This is the kind of thing that smells of a security issue. Your Service is
probably running with the LocalSystem account in its own Windowstation, but
trying to drive a Word application that may be installed for a different
user, or that can't access the interactive user's desktop.
What happens if you run the Service under your account name/password?
--
Phil Wilson [MVP Windows Installer]
"Andrei" <pr**********@h otmail.com> wrote in message
news:00******** *************** *****@phx.gbl.. . Hello,
I posted yesterday the same problem, but now I want to be more specific about it.
My intention is to create a windows service to process some Word documents. If I use CreateObject to create a reference to a Word object everything is working fine.
If I use GetObject to get a reference to Word object (of course that Word applicaton is started) I get an error ("Cannot create ActiveX component")
It is like my service cannot detect that Word application is started.
I want to say that GetObject is working fine from a standard Windows application.
Thank you, Andrei This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Gerry |
last post by:
I have a developer here with a website running with only "Windows
Integrated Authentication" set on a Windows 2000 member server that
uses GetObject to get a user's group membership in the domain. This is
the code she's using:
set adsUser = getobject("WinNT://" & strUsername)
for each group in adsUser.groups
GrpList = GrpList & lcase(trim(group.name)) & ";"
next
|
by: CJM |
last post by:
I'm building an ASP app that uses Windows Authentication (IWA).
I have an authentication routine that assesses if & how the user can use the
application (see code snippet below). Users of a particular group have full
permissions (configured via IIS) and all other users have read/execute
permissions.
When I call the authentication page from the server on my own PC, everything
seems to work, but I guess this is not a respresentative...
|
by: Andrei Prodan |
last post by:
Hi everyone,
I have a small piece of code which uses GetObject function
and it is working fine in a windows application developed
under .NET
In a windows service application, the GetObject function
returns an error: "Cannot create ActiveX component"
Does anyone knows why ??
|
by: bic |
last post by:
When porting my Windows app to asp.net I get an System.Exception: Cannot
create ActiveX component. What function can I use instead? Thanks for your
comments.
--
bic
|
by: Otie |
last post by:
I found the following under the GetObject help notes and in the
example for GetObject:
"This example uses the GetObject function to get a reference to a
specific Microsoft Excel worksheet (MyXL). It uses the worksheet's
Application property to make Microsoft Excel visible, to close it, and
so on. Using two API calls, the DetectExcel Sub procedure looks for
Microsoft Excel, and if it is running, enters it in the Running Object
Table. The...
| |
by: Yong Yu |
last post by:
Dear All,
I have to move my VB code to C#. But I have no idea on the GetObject method
in Vb.
-----------------------------------------
Set dom = GetObject("WinNT://" & domain)
-----------------------------------------
This is easy for VB to get the object by COM monikor interface.
|
by: perspolis |
last post by:
Is there a method like GetObject in vb to get an instance of current object
runnig??
|
by: Andrei |
last post by:
Hello,
I posted yesterday the same problem, but now I want to be
more specific about it.
My intention is to create a windows service to process
some Word documents. If I use CreateObject to create a
reference to a Word object everything is working fine.
If I use GetObject to get a reference to Word object (of
|
by: aydeejay |
last post by:
I'm trying to troubleshoot an issue where users are not able to bind
with LDAP via "GetObject" through our ASP Classic Intranet if they
stay logged in overnight (beyond their allowed login hours). The
problem does not occur when performing the same bindings using a logon
script.
So, the user logs in, is able to perform queries all day, and then
fails to log out at the end of the day. We'd prefer that they did log
out nightly, but it...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |