Change the behavior of "Save Frame As"?

P

plh

Office 2003:
We have a system whereby sales engineers create spec. sheet by filling out the
left frame in a read-only two-frame document (the right frame containing
instructions) then using RightClick/Save Frame As to save the resulting spec.
sheet under a new name. What we would like to do is have the Save As dialog
window, instead of showing the same folder where the original document resides
and the suggested name "Document1.doc", default to a folder and suggested file
name predetermined by information contained in fields on the frame. My guess is
that this can be done through a custom .dot, but I would greatly appreciate some
help getting started. I am new to VBA in Word but have extensive experience with
it in Excel and Access. I have looked at the SaveAs Method and DefaultSaveFormat
Property in help but my questions are:
1) How to change the default folder. I see the part about the file name (SaveAs
Method). Can I use a drive\path\name in that parameter such as
"I:\Shared\Marketing\Smith\COPs\23456Specs.doc"
2) How to make this happen in response to RightClick/Save Frame As.
Thank You,
plh
 
J

Jean-Guy Marcil

plh was telling us:
plh nous racontait que :
Office 2003:
We have a system whereby sales engineers create spec. sheet by
filling out the left frame in a read-only two-frame document (the
right frame containing instructions) then using RightClick/Save Frame
As to save the resulting spec. sheet under a new name. What we would
like to do is have the Save As dialog window, instead of showing the
same folder where the original document resides and the suggested
name "Document1.doc", default to a folder and suggested file name
predetermined by information contained in fields on the frame. My
guess is that this can be done through a custom .dot, but I would
greatly appreciate some help getting started. I am new to VBA in Word
but have extensive experience with it in Excel and Access. I have
looked at the SaveAs Method and DefaultSaveFormat Property in help
but my questions are: 1) How to change the default folder. I see the
part about the file name (SaveAs Method). Can I use a drive\path\name
in that parameter such as
"I:\Shared\Marketing\Smith\COPs\23456Specs.doc" 2) How to make this
happen in response to RightClick/Save Frame As.
Thank You,
plh

You can highjack the SaveFrameAs command with a sub that uses the exact name
as in this example:
Make sure you store the Sub in the project associated with the frame in the
VBA Editor.

'_______________________________________
Sub FileSaveFrameAs()

Dim strUserPAth

'Save user current directory
strUserPAth = CurDir

'Do the save
With Dialogs(wdDialogFileSaveAs)
.Name = "I:\Shared\Marketing\Smith\COPs\"
.Show
End With

'Reset the open/save directory
Application.ChangeFileOpenDirectory strUserPAth

End Sub
'_______________________________________


If you want to use a file name as well as a path name, change

.Name = "I:\Shared\Marketing\Smith\COPs\"

to

.Name = "I:\Shared\Marketing\Smith\COPs\MyDocument.doc"

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
P

plh

plh was telling us:
plh nous racontait que :


You can highjack the SaveFrameAs command with a sub that uses the exact name
as in this example:
Make sure you store the Sub in the project associated with the frame in the
VBA Editor.

'_______________________________________
Sub FileSaveFrameAs()

Dim strUserPAth

'Save user current directory
strUserPAth = CurDir

'Do the save
With Dialogs(wdDialogFileSaveAs)
.Name = "I:\Shared\Marketing\Smith\COPs\"
.Show
End With

'Reset the open/save directory
Application.ChangeFileOpenDirectory strUserPAth

End Sub
'_______________________________________


If you want to use a file name as well as a path name, change

.Name = "I:\Shared\Marketing\Smith\COPs\"

to

.Name = "I:\Shared\Marketing\Smith\COPs\MyDocument.doc"

Dear Jean-Guy,
Thank you, we will try it!
-plh
 

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