Dear group,
I have a command button on a form. When I click this
button, I want a specific word document to be opened.
This is the code I have typed in to the "Click" event
of the command button.
Private Sub cmdOpenSESReportDoc_Click()
Dim objApp As Word.Application
Dim objWord As Word.Document
Set objApp = CreateObject("Word.Application")
Set objWord =
objApp.Documents.Open(FileName:="C:Report\SES_Report\SES_Rep_0001.doc")
objApp.Visible = True
I keep getting a message "Compile Error, User-Defined
type not defined".
Eventually I would like a word document to be launched
based on a Field called "SES_Report_ID" So if
SES_Report_ID" = SES_Rep_0001 then when the command
button "Open SES report" is clicked, that particular
report is opened in word.
I would appeciate any feedback on this.
I am new to VBA.
Thanks in advance.
Irshad
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~->
Please zip all files prior to uploading to Files section.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AccessDevelopers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/