Hey everyone,
I need a little bit of code help. When the user clicks on a command button, I want windows to launch a new word document. Any help?
Thanks in advance
Justin
Printable View
Hey everyone,
I need a little bit of code help. When the user clicks on a command button, I want windows to launch a new word document. Any help?
Thanks in advance
Justin
Dim oWord As New Word.Application
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Activate
Thanks for the reply....Do I put that command in the button, or form load, or form activate. Thanks
Justin
Yes, put that into a CommandButton.
Thanks everyone
Sorry to be such a pain and I am trying to do this on my own, but I keep getting a user defined type error when I run the code.
Thanks again
Justin
Private Sub CmdItem_Click()
Dim oWord As New Word.Application
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Activate
End Sub
Sorry, I forgot to mention that you need to reference the Word 8.0 Object Library.
Menu Path: Project > References
Then find the Microsoft Word 8.0 Library and check the box next to it. Press the "OK" button.
Enjoy.