Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2003, 10:16 AM
Registered User
 
Join Date: Jun 2003
Location: , LA, .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening a .doc file for view

I have a variable named StrJobNum that i get from a list box that the user selects. On my hard drive are .doc files that each match one of the given selections from the list box. So what I need is for my program to then open the .doc files in word with something like "C:\My Documents\StrJobNum.doc" and I have each file for every given situation for StrJobNum. So if my StrJobNum is A1024, I want it to open C:\My Documents\A1204.doc in word, or if possible then make it splash up onto the screen. Thanks guys :) I wish i was smart enough but i haven't got there yet :(
Reply With Quote
  #2 (permalink)  
Old June 12th, 2003, 09:37 PM
Authorized User
 
Join Date: Jun 2003
Location: , , Japan.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you don't feel put off by the Win API (and you shouldn't be in this case) I'd say try ShellExexcute.

Details here http://vbaccelerator.nuwebhost.com/c...ll/shellex.htm or http://support.microsoft.com/default...en-us%3B170918 here.

If you still have problems are reading these post back.
Reply With Quote
  #3 (permalink)  
Old June 14th, 2003, 02:56 PM
Registered User
 
Join Date: Jun 2003
Location: Tucson, AZ, .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found this code that opens it in Read Only mode, but I imagine you could change the attributes to make it editable:

Set WordApp = CreateObject("Word.Application")
    WordApp.Visible = True
    WordApp.Documents.Open ("C:\Temp\Test1.Doc")

Pete S - Tucson, AZ

Pete S - Tucson, AZ
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem opening Excel Doc when using AxBrowser sroy C# 2 September 19th, 2006 06:07 AM
Opening a doc file using a jsp karthik_talasu Javascript 3 June 27th, 2006 08:02 AM
Problem in opening .doc file kumar_raj13 C# 1 March 13th, 2006 12:57 PM
opening doc (in another server) thisgal1213 Classic ASP Basics 1 January 3rd, 2006 08:55 PM



All times are GMT -4. The time now is 03:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.