display a ok and cancel button when trying to open dot file ! Please

G

gravesen

Hi I am trying to make an dialog box with a ok and a cancel box.
If I press the ok button I would like to rund the letter_enquiry.do
and if I hit cancel nothing will happen.

This is the code I have right now just with a msgbox and a ok

Can anyone help me with this


Sub letterofenquiry()
'
' Letterofenquiry Makro
' Makro indspillet 16-03-2004 af Lars Gravesen
Dim letterofenquiry As Object
MsgBox "Microsoft Excel is not currently running."
Set letterofenquiry = CreateObject("word.application")
letterofenquiry.Documents.Add ThisDocument.Path & "\"
"letter_enquiry.dot"
letterofenquiry.Visible = True
NewTemplate = False
DocumentType = 0

End Sub



Thanks

Lars Gravese
 
H

Helmut Weber

Hi Lars,
like this
Dim iRsl As Integer ' result from messagebox function
Dim sMsg As String ' a message
sMsg = "Microsoft Excel is not currently running."
iRsl = MsgBox(sMsg, vbOKCancel)
If iRsl = vbOK Then MsgBox "ok"
If iRsl = vbCancel Then MsgBox "cancel"
 
W

Word Heretic

G'day gravesen <<[email protected]>>,

You need to create a UserForm. There is info at the MVP site, the Word
help system and in a dedicated newsgroup. Please post followup
questions there :)


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top