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 / April 2007

Tip: Looking for answers? Try searching our database.

Help on trapping for wdDialogFileSaveAs?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Armey - 01 Apr 2007 05:37 GMT
Hi, i was working on a recent problem with trapping on printing events
in a protected template and realized I had a similar need for password
protecting the save, save as, save as web page options in MS Word
2003.  I repurposed my printing code for my traps on saving (see
below).  I have figured out how to trap for the save icon, the file
save, the file save as, but I cant figure out how to trap for the file
save as web command.  Any thoughts?

Public Sub FileSave()
   Dim SaveRet As Long
   Dim Reply1 As String
   Reply1 = InputBox("Save Password", "Saving is restricted, enter
your password", "    ")
   If Reply1 = pwFileSave Then
       SaveRet = Dialogs(wdDialogFileSaveAs).Show
   End If
End Sub

Sub FileSaveAs()
FileSave
End Sub

Sub FileSaveAll()
FileSave
End Sub
Doug Robbins - Word MVP - 01 Apr 2007 06:48 GMT
Some of these won't be applicable to Word 2003, but in 2007 the commands
that you would need to trap are:

FileSave
FileSaveAll
FileSaveAs
FileSaveAsOtherFormats
FileSaveAsWebPage   -    Probably the one you want
FileSaveFrameAs
FileSaveHTML  -  You may also need this
FileSaveWord11
FileSaveWordDocx
FileSaveWordDotx

You won't nee the last 2

You can get the names of all of these that are applicable by selecting "Word
commands" from the "Macros in:" pull down in the Macros Dialog.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi, i was working on a recent problem with trapping on printing events
> in a protected template and realized I had a similar need for password
[quoted text clipped - 21 lines]
> FileSave
> End Sub
Armey - 01 Apr 2007 12:32 GMT
On Apr 1, 12:48 am, "Doug Robbins - Word MVP"
<d...@REMOVECAPSmvps.org> wrote:
> Some of these won't be applicable to Word 2003, but in 2007 the commands
> that you would need to trap are:
[quoted text clipped - 50 lines]
>
> - Show quoted text -

Doug, you are the man... thank you very much.  I am glad that you
pointed out the 2007 versions since some of the users may be using
this version.  Thank you.
Armey - 01 Apr 2007 12:56 GMT
On Apr 1, 12:48 am, "Doug Robbins - Word MVP"
<d...@REMOVECAPSmvps.org> wrote:
> Some of these won't be applicable to Word 2003, but in 2007 the commands
> that you would need to trap are:
[quoted text clipped - 50 lines]
>
> - Show quoted text -

Doug, I did have another question about the wdDialogFileSaveAs
Dialog.  When I implement my code above and the user tries to save
their document, and not do a save as, obviously using this dialog they
can only perform the save as, and not a traditional save function.  Is
there any way to accomplish my goal of protecting the savie function
and not use the wdDialogFileSaveAs for the traditional save?  In
short, my FileSave() Sub works as designed for everyting except the
regular file save since it calls that dialog.  Any help or thoughts is
appreciated.
 
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.