Results 1 to 5 of 5

Thread: Visual Basic Programming Question

  1. #1

    Question Visual Basic Programming Question

    Does anybody know how to launch a word document using visual basic code?

    any help would be greatly appreciated.
    [gloworange]Antyx[/gloworange] .. formerly lupdawg

  2. #2
    Senior Member
    Join Date
    Dec 2003
    Location
    LA, CA
    Posts
    292
    It's been a while, but i think it goes like this:
    Code:
    dim thedoc as object
    set thedoc = CreateObject("Word.Application")
    thedoc.Documents.Open FileName:="c:\urfile.doc"
    thedoc.Visible = True
    thedoc.Active
    A mind full of questions has no room for answers

  3. #3
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    using the shellexecute function should work too !!

    Code:
    ShellExecute hwnd, "open", "c:\the\word_file.doc", vbNullString, vbNullString, SW_SHOW
    you might need to declare some stuff

    Code:
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Private Const SW_SHOW = 5
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  4. #4
    Senior Member
    Join Date
    Feb 2004
    Posts
    620
    Originally posted here by hiddeninclouds
    It's been a while, but i think it goes like this:
    Code:
    dim thedoc as object
    set thedoc = CreateObject("Word.Application")
    thedoc.Documents.Open FileName:="c:\urfile.doc"
    thedoc.Visible = True
    thedoc.Active
    Only one problem with this code:

    thedoc.Active

    should be changed to

    thedoc.Activate

    Later,

    mjk

  5. #5
    Thank you mjk and the jinx , your help is greatly appreciated, i will be trying each of your codes and will get back to you on what works and what didnt,

    Thanks again!
    [gloworange]Antyx[/gloworange] .. formerly lupdawg

Posting Permissions

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