Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2008, 10:21 AM
Friend of Wrox
 
Join Date: Apr 2007
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default Office Automation- open word document

Hi All

I am using this code to open word document from access but when you close word document, it ask you save as templete and i found it create process on task manager

I am not sure is this correct way to open and view documnet


here's code

Dim wd As Word.Application
Set wd = New Word.Application
wd.Documents.Open (r!FDestination)
'wd.Application.Documents.Open fileName:=r!Destination,ReadOnly:=True
'wd.Documents.Open r!FDestination, ReadOnly:=True
wd.Application.Visible = True
Set wd = Nothing


Thanks

Ayaz


 
Old October 17th, 2008, 09:23 AM
Authorized User
 
Join Date: Jan 2006
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default


hi use this code if msword is on d drive.i:e if program files is in d drive then use after the click event of a command button e:g command0


Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

    Dim stAppName As String

    stAppName = "D:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"
    Call Shell(stAppName, 1)

Exit_Command0_Click:
    Exit Sub

Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click

End Sub

if it is on c drive i:e if program files is in c drive then use after the click event of a command button e:g command0
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

    Dim stAppName As String

    stAppName = "c:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"
    Call Shell(stAppName, 1)

Exit_Command0_Click:
    Exit Sub

Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click

End Sub


 
Old November 4th, 2008, 12:01 PM
pjm pjm is offline
Authorized User
 
Join Date: Jul 2006
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wouldn't wd.Quit do the trick?


-Phil-





Similar Threads
Thread Thread Starter Forum Replies Last Post
open word document and insert data PorcupineRabbit Visual Basic 2005 Basics 1 August 9th, 2007 06:31 PM
Help need to geneate word doc in open office satyakishore Servlets 0 March 16th, 2006 04:14 AM
open, change a excel document from word kareltje Excel VBA 2 February 14th, 2005 11:23 AM
Cannot open Word Document At Client Side leo_ling Classic ASP Basics 6 July 1st, 2004 12:31 AM
How to open word document using ASP and read ksaleemkhan Classic ASP Components 3 April 28th, 2004 04:43 PM





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