Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

automatically close a doc after user clicks on email send?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reb - 29 Jan 2005 01:55 GMT
Hi All

I have a word form ready with the email header active in the document.  When
I select Send on the email, the document remains open.  I would like it
automatically close once the send button is hit.  I found that  the
ActiveWindow.EnvelopeVisible toggles the word email header.

I have got this far via the web but I really have no idea:

created a Class Module -clsobject:

Public WithEvents oApp As Word.Application

Private Sub oApp_DocumentChange()
' dunno what to put here
End Sub

created a module:

Dim oAppClass As New clsObject
 
  Public Sub AutoExec()
   Set oAppClass.oApp = Word.Application

  If ActiveWindow.EnvelopeVisible = False Then
     ActiveDocument.Close
       End If

End Sub

Any ideas?  Thanks in advance
Doug Robbins - 29 Jan 2005 11:57 GMT
In Word, if you create a macro with the name of one of Word's commands, that
macro will run in place of the built-in command.  In this case, the name of
the macro needs to be FileSend().

See the second method in the article the article "How to send an email from
Word using VBA" at:

http://word.mvps.org/FAQs/InterDev/SendMail.htm

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Hi All
>
[quoted text clipped - 28 lines]
>
> Any ideas?  Thanks in advance
anonymous@discussions.microsoft.com - 29 Jan 2005 14:06 GMT
Hi

I created a macro called sub filesend() and followed the
links instructions.  Running this macro creates a new
message and all the works but I couldnt get it to autorun
after pressing the FileSend comman is run.  I would like it
to intercept the filesend event so that the
activedocument.close can run after the filesend has been
passed.

Thanks for your help.

>-----Original Message-----
>In Word, if you create a macro with the name of one of Word's commands, that
[quoted text clipped - 40 lines]
>
>.
Doug Robbins - 29 Jan 2005 22:34 GMT
Sorry, the macro should be named FileSendMail()  That one runs when the
File>Send To>Mail Recipients as Attachment command is selected.

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Hi
>
[quoted text clipped - 65 lines]
>>
>>.
anonymous@discussions.microsoft.com - 30 Jan 2005 00:23 GMT
Thanks Doug :)

>-----Original Message-----
>Sorry, the macro should be named FileSendMail()  That one runs when the
[quoted text clipped - 71 lines]
>
>.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.