Results 1 to 3 of 3

Thread: client-side automation: word

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166

    client-side automation: word

    when the button is clicked, i'd like to open word (the application itself) on the client-machine and it should generate a report of the data the user has just submitted to the server (sql 2000)

    because this didn't work as i thought it would, i made a test-project: a page with one button that opens word and a certain document for me...

    the code executes, but i don't see word opening on my screen. Under processes a proces winword.exe has started... is there something wrong with my code or is it my configuration?


    Code:
    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1"%>
    
    <HTML>
    
    	<HEAD>
    
    		<title>WebForm1</title>
    
    		<script language="vbscript" runat="server">
    
    			dim objword
    
    						
    
    			Sub Button_Click(s as Object, e as EventArgs)
    
    				objword = CreateObject("Word.Application")
    
    				objword.documents.open("C:\testdoc.doc")
    
    				objword.visible = true
    
    				objword = nothing
    
    			End Sub	
    
    		</script>
    
    	</HEAD>
    
    	<body MS_POSITIONING="GridLayout">
    
    		<form id="Form1" method="post" runat="server">
    
    <asp:Button id="Button1" runat="server" Text="Button" Width="126px" Height="47px" OnClick="Button_Click">
    
    </asp:Button>
    
    		</form>
    
    	</body>
    
    </HTML>
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    That code will run on the server. So if you're testing it from the same computer - you'll see the word process start - but its starting "server-side" and not "client-side"...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    (http://www.infinetsoftware.com/conte...edocuments.asp)

    any comments about this technique? is it the best one for what i am trying?
    never argue with an idiot, he will bring you down to his level and will beat you through experience

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width