Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   Word automation using asp and VBA (http://www.go4expert.com/forums/word-automation-using-asp-vba-t1439/)

kalees 20Sep2006 14:20

Word automation using asp and VBA
 
Hi,
i am having problem with word automation. my code is working fine in my local system.but when i deployed the code and resigerted the dll also into the terminal server it is not working. i am using word2003 professional but terminal server contains word2003 standard. please anyone help me.
This is my dll coding,
Code:

Option Explicit
    Private mwrdApp As Word.Application 'Holds Word instance


    Private Sub Class_Initialize ()
      Set mwrdApp = New Word.Application 'Create Word instance
    End Sub


    Private Sub Class_Terminate ()
      mwrdApp.Quit 'Kill Word instance
      Set mwrdApp = Nothing 'Kill reference
    End Sub


    Public Function GetWord () As Word.Application
      Set GetWord = mwrdApp 'Return Word instance
    End Function

This is my asp coding,

Code:

<%
    Set WordServer = Server.CreateObject("Test.Wordserver")
    Set objWordobject = WordServer.GetWord 'Get Word instance

    objWordobject.Visible = True

  strTemplate="c:\template.dot"
  'Open doc
          Set objDocobject=objWordobject.Documents.add(strTemplate)

%>


shabbir 20Sep2006 14:50

Re: Word automation using asp and VBA
 
When you use Word.Application by adding a reference to word application the compiled code becomes tightly coupled with the version of the word used and the client also should have the same version. Either you need to compile the code on the client machine or use the same version when writing the code.

I had the same problem with MS Outlook with version 9 and 10 conflict and the last thing I wanted to do is downgrade my office from XP to 2000 and I had to do that for the successful running of my application.

kalees 20Sep2006 19:16

Re: Word automation using asp and VBA
 
hi shabbir,

Thanks for your wonderful reply.
If so then how can i create a generalized dll for my application?

according to you, all my clients who are running my application should have same version in their system that my server has right?

please advice me.


Thanks,
Kalees

shabbir 20Sep2006 19:27

Re: Word automation using asp and VBA
 
Yes thats true. Or if you are unsure of the client version as to what he might be running use the different dlls and have an installer to detect the office version and copy the correct dll. You may even need to use InstallShield instead of the default dll setup utility.

kalees 20Sep2006 20:43

Re: Word automation using asp and VBA
 
Hi Shabbir,
Thanks once again.

Can you briefly explain about the installer or InstallShield? how to create it and use it?
I have a doubt on word automation, suppose one client might use my application that time whether the dll open the server word document or client's pc word document?

Please guide me.because i have to deliver this very soon. :confused:



Thanks,
Kalees

shabbir 20Sep2006 20:48

Re: Word automation using asp and VBA
 
Quote:

Originally Posted by kalees
Can you briefly explain about the installer or InstallShield? how to create it and use it?

http://www.macrovision.com/products/...ld/index.shtml
Quote:

Originally Posted by kalees
I have a doubt on word automation, suppose one client might use my application that time whether the dll open the server word document or client's pc word document?

The best option for fast delivery would be to have multiple dll's for each version of word and load the particular dll for the specific version found on the system

kalees 20Sep2006 21:26

Re: Word automation using asp and VBA
 
Hi shabbir,
Thanks for the reply.

But i tested word automation like this,
i installed the dll and asp page into the another system and open the page from my system like this

http://192...(ip address of the another system)/virtualdirectory of the another system/asppage.asp

but the word document is opening in the another system not in my system.

My requirement is opening a word document from a server and user can save it in to their pc. please kindly advise.




Thanks,
Kalees

kalees 20Sep2006 22:05

Re: Word automation using asp and VBA
 
Hi Shabbir,

How to download a word document from a server automatically and save it to the client system?
Before the download, i have to open the file and change some content in the server.

Thanks,
Kalees

shabbir 21Sep2006 11:02

Re: Word automation using asp and VBA
 
Are you asking how to allow download of a word document. Just place a link to the word doc and clicking will download on the client machine.

kalees 21Sep2006 12:49

Re: Word automation using asp and VBA
 
Hi Shabbir,

Thanks for the reply.

how to allow download of a word document from server automatically?
consider this situation,

one user use my application and fill up some information over the form and he want to take copy of it. here we reteirve all the values from the form and replaces with these values over the word template already we have on the server. Finally we allow to download as word document.

do you understand the requirement?


Thanks,
Kalees


All times are GMT +5.5. The time now is 07:32.