Results 1 to 6 of 6

Thread: word automation

  1. #1

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

    word automation

    i'd like to open word when i click a button on my .aspx-page

    i have 'imports office" at the beginning of my page

    this is my subroutine:
    ¨
    Code:
    Private Sub ButtonBrief_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonBrief.Click
    
            Dim WORDAPP As Word.Application
    
            Dim WORDDOC As Word.Document
    
    
    
            'start word and open the document template
    
            WORDAPP = CreateObject("Word.Application")
    
            WORDAPP.Visible = True
    
            WORDDOC = WORDAPP.Documents.Add
    
    end sub

    the code executes but nothing happens, i can't find word in the taskmanager either... any ideas?

    greetz

    Tim
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    i'm sorry, checked again, and WINWORD.EXE is running! (under processes only, not tasks) ...MS word isn't visible though ... can anyone help me? I can't get the automation going and i need to generate a letter from an ASP.NET page....
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  3. #3
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    You'll be creating the word document on the server so you won't be able to view it on the client unless you save it and download it to the client.

    HTH

    DJ

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    any advise on how i could do that ?
    never argue with an idiot, he will bring you down to his level and will beat you through experience

  5. #5
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    Well you'll have to create the word doc blind and then use the SaveAs method to save the created document to the server. You can then just display a link on a page pointing to the path and filename you created.

    DJ

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Location
    Gent
    Posts
    166
    that's a pretty good idea... that way i don't have to generate it every time it's been requested...

    i'll see if i can do it this way...thanx...
    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