Click here to Skip to main content
15,923,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Masked Boxes Pin
icowa21-Jun-05 0:43
icowa21-Jun-05 0:43 
GeneralRe: Masked Boxes Pin
icowa21-Jun-05 1:03
icowa21-Jun-05 1:03 
GeneralRe: Masked Boxes Pin
J4amieC21-Jun-05 4:41
J4amieC21-Jun-05 4:41 
GeneralRe: Masked Boxes Pin
lespaul3621-Jun-05 11:11
lespaul3621-Jun-05 11:11 
GeneralRe: Masked Boxes Pin
icowa21-Jun-05 15:20
icowa21-Jun-05 15:20 
Generalcontorl on word save message prompt Pin
paykani20-Jun-05 21:53
paykani20-Jun-05 21:53 
GeneralRe: contorl on word save message prompt Pin
jonathan1521-Jun-05 3:31
jonathan1521-Jun-05 3:31 
GeneralRe: contorl on word save message prompt Pin
jonathan1521-Jun-05 3:59
jonathan1521-Jun-05 3:59 
OK. A simple example for you. All it does is replace words save box with my own.


Private WithEvents oword As Word.Application<br />
Private WithEvents odoc As Word.Document<br />
Private Sub Command1_Click()<br />
<br />
Set oword = New Word.Application<br />
oword.Visible = True<br />
Set odoc = oword.Documents.Open("yourfile.doc")<br />
End Sub<br />
<br />
<br />
Private Sub oword_DocumentBeforeClose(ByVal Doc As Word.Document, Cancel As Boolean)<br />
<br />
If MsgBox("Do you want to save this file?", vbYesNo, "Save") = vbYes Then<br />
    oword.Activate ' not required if oword is not visible<br />
    odoc.Save<br />
    oword.Documents.Close 'If using word 2000 or below i think you need the argument here to not save changes. That will suppress words messagebox but this works fine with word 2003<br />
    <br />
    oword.Quit<br />
Else<br />
    oword.Activate<br />
    oword.Documents.Close<br />
    oword.Quit<br />
End If<br />
<br />
Set odoc = Nothing<br />
Set oword = Nothing<br />
End Sub

GeneralRe: contorl on word save message prompt Pin
Anonymous21-Jun-05 18:40
Anonymous21-Jun-05 18:40 
Generalcontrol on word save message prompt Pin
Anonymous20-Jun-05 21:44
Anonymous20-Jun-05 21:44 
GeneralWord application Instance closing in VB Pin
Anonymous20-Jun-05 20:12
Anonymous20-Jun-05 20:12 
GeneralRe: Word application Instance closing in VB Pin
jonathan1521-Jun-05 4:10
jonathan1521-Jun-05 4:10 
Generalcalling back a previous form.. Pin
icowa20-Jun-05 17:42
icowa20-Jun-05 17:42 
GeneralRe: calling back a previous form.. Pin
icowa20-Jun-05 17:44
icowa20-Jun-05 17:44 
GeneralRe: calling back a previous form.. Pin
Christian Graus20-Jun-05 17:54
protectorChristian Graus20-Jun-05 17:54 
GeneralRe: calling back a previous form.. Pin
icowa20-Jun-05 17:59
icowa20-Jun-05 17:59 
GeneralRe: calling back a previous form.. Pin
Christian Graus20-Jun-05 18:04
protectorChristian Graus20-Jun-05 18:04 
GeneralRe: calling back a previous form.. Pin
Anonymous20-Jun-05 18:35
Anonymous20-Jun-05 18:35 
GeneralRe: calling back a previous form.. Pin
Anonymous20-Jun-05 18:37
Anonymous20-Jun-05 18:37 
GeneralRe: calling back a previous form.. Pin
Christian Graus20-Jun-05 18:39
protectorChristian Graus20-Jun-05 18:39 
GeneralRe: calling back a previous form.. Pin
icowa20-Jun-05 18:48
icowa20-Jun-05 18:48 
GeneralRe: calling back a previous form.. Pin
Christian Graus20-Jun-05 18:53
protectorChristian Graus20-Jun-05 18:53 
GeneralRe: calling back a previous form.. Pin
Dave Kreskowiak21-Jun-05 2:36
mveDave Kreskowiak21-Jun-05 2:36 
GeneralRe: calling back a previous form.. Pin
lespaul3620-Jun-05 18:53
lespaul3620-Jun-05 18:53 
GeneralRe: calling back a previous form.. Pin
Christian Graus20-Jun-05 19:00
protectorChristian Graus20-Jun-05 19:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.