-
May 31st, 2004, 05:50 PM
#1
Member
Visual Basic Programming Question
Does anybody know how to launch a word document using visual basic code?
any help would be greatly appreciated.
-
May 31st, 2004, 07:39 PM
#2
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 
-
June 2nd, 2004, 10:51 AM
#3
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 !
-
June 5th, 2004, 12:17 AM
#4
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
-
June 8th, 2004, 08:22 PM
#5
Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|