Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Opening files

Ben,

The first thing you need to do is add references to word and
powerpoint to your project.

"Tools" - "References" and check off
Microsoft Word X.X Object Library
Microsoft PowerPoint X.X Object Library
where X.X is your version of Word/Powerpoint

Then to open a word document

Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Set wdApp = CreateObject("Word.Application")
OpenWhat = Application.GetOpenFilename("Microsoft Word Documents (*.doc), *.doc")
Set wdDoc = wdApp.Documents.Open(OpenWhat, , True)
wdApp.Visible = True

To open a powerpoint file

Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Set ppApp = CreateObject("PowerPoint.Application")
OpenWhat = Application.GetOpenFilename("Microsoft PowerPoint Presentation (*.ppt), *.ppt")
Set ppPres = ppApp.Presentations.Open(OpenWhat, msoFalse, msoFalse, msoFalse)
ppApp.Visible = msoCTrue

Dan E


"Ben E" wrote in message ...
Hi all

I am looking for a little help, what I would like to do is
open files from within another application namely MS Word,
i.e. when the user presses the button a Word document will
be opened and activated, I also need for the file to open
as read only.

I also need to do the same for a PowerPoint file.

Any help would be appreciated

Cheers
Ben




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
show most recent files first when opening excel files Anne` Excel Discussion (Misc queries) 5 January 23rd 08 01:54 AM
Opening files Rmarsh5248 Excel Discussion (Misc queries) 1 October 10th 07 11:08 PM
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 PoundMutt Excel Discussion (Misc queries) 1 June 20th 07 03:50 AM
How can I view files chronologically when opening multiple files Stevilsize Excel Discussion (Misc queries) 3 July 26th 05 12:49 AM
Opening CSV Files Andrew Young Excel Programming 0 July 22nd 03 12:09 PM


All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"