SaveAs Filename based on Form Field Value 
Author Message
 SaveAs Filename based on Form Field Value

Hi There,

I'm trying to create a word macro to save a document based on a value
typed into a form field. The value is just a six figure id, and what I
want to happen is that when the maco is executed it pops up the SaveAs
dialogue box with the field six figure id suggested as the file name. I
know this must be possible but cannot find the correct syntax to
complete this.
Does anybody have any ideas on this? I'm fairly new to this so go easy
on me :)

Carl.



Fri, 22 Aug 2003 22:58:54 GMT  
 SaveAs Filename based on Form Field Value
Hi Carl,

Quote:
> I'm trying to create a word macro to save a document based on a value
> typed into a form field. The value is just a six figure id, and what I
> want to happen is that when the maco is executed it pops up the SaveAs
> dialogue box with the field six figure id suggested as the file name.

The following will display the SaveAs dialog with with the filename you
specify:

With Dialogs(wdDialogFileSaveAs)
    .Name = "ID here"
    .Show
End With

--
Hope this helps.
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.



Fri, 22 Aug 2003 23:32:53 GMT  
 SaveAs Filename based on Form Field Value
Thanks for the reply Ibby,

Where you have "ID here" in your in your example, is that an ID that uniquely
identifies the field? I need to derive the filename from whatever six figure
value the user enters in the field on the form. So on each new form the
filename will be different as each value in the field will be unique.

Hope this is clearer, or maybe I just don't understand.

Carl.

Quote:
> Hi Carl,

> > I'm trying to create a word macro to save a document based on a value
> > typed into a form field. The value is just a six figure id, and what I
> > want to happen is that when the maco is executed it pops up the SaveAs
> > dialogue box with the field six figure id suggested as the file name.

> The following will display the SaveAs dialog with with the filename you
> specify:

> With Dialogs(wdDialogFileSaveAs)
>     .Name = "ID here"
>     .Show
> End With

> --
> Hope this helps.
> ibby

> Please post replies or follow-ups to the **newsgroup** so that participants
> may benefit or contribute.



Sat, 23 Aug 2003 03:11:15 GMT  
 SaveAs Filename based on Form Field Value
Hi Carl,

By

Quote:
> >     .Name = "ID here"

Ibby means the ID value as stored in Form field where you keep
the 6 digit ID value, like:

    .Name = ActiveDocument.FormFields("My_ID_FormField").Result

Krgrds,
Perry



Quote:
> Thanks for the reply Ibby,

> Where you have "ID here" in your in your example, is that an ID that
uniquely
> identifies the field? I need to derive the filename from whatever six
figure
> value the user enters in the field on the form. So on each new form the
> filename will be different as each value in the field will be unique.

> Hope this is clearer, or maybe I just don't understand.

> Carl.

> > Hi Carl,

> > > I'm trying to create a word macro to save a document based on a value
> > > typed into a form field. The value is just a six figure id, and what I
> > > want to happen is that when the maco is executed it pops up the SaveAs
> > > dialogue box with the field six figure id suggested as the file name.

> > The following will display the SaveAs dialog with with the filename you
> > specify:

> > With Dialogs(wdDialogFileSaveAs)
> >     .Name = "ID here"
> >     .Show
> > End With

> > --
> > Hope this helps.
> > ibby

> > Please post replies or follow-ups to the **newsgroup** so that
participants
> > may benefit or contribute.



Sat, 23 Aug 2003 04:43:25 GMT  
 SaveAs Filename based on Form Field Value
Ibby and Perry

Thanks - works a treat!

Carl.

Quote:

> Hi Carl,

> By
> > >     .Name = "ID here"

> Ibby means the ID value as stored in Form field where you keep
> the 6 digit ID value, like:

>     .Name = ActiveDocument.FormFields("My_ID_FormField").Result

> Krgrds,
> Perry



> > Thanks for the reply Ibby,

> > Where you have "ID here" in your in your example, is that an ID that
> uniquely
> > identifies the field? I need to derive the filename from whatever six
> figure
> > value the user enters in the field on the form. So on each new form the
> > filename will be different as each value in the field will be unique.

> > Hope this is clearer, or maybe I just don't understand.

> > Carl.

> > > Hi Carl,

> > > > I'm trying to create a word macro to save a document based on a value
> > > > typed into a form field. The value is just a six figure id, and what I
> > > > want to happen is that when the maco is executed it pops up the SaveAs
> > > > dialogue box with the field six figure id suggested as the file name.

> > > The following will display the SaveAs dialog with with the filename you
> > > specify:

> > > With Dialogs(wdDialogFileSaveAs)
> > >     .Name = "ID here"
> > >     .Show
> > > End With

> > > --
> > > Hope this helps.
> > > ibby

> > > Please post replies or follow-ups to the **newsgroup** so that
> participants
> > > may benefit or contribute.



Sat, 23 Aug 2003 17:34:55 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Moving a field on a report, based on value of another field

2. Starting query from a form (criterium being based on a text field in the form)

3. table.field value calculated based on query

4. Setting vb actions based on the value in a field

5. sorting records from 1 table into several based on a field value

6. Assigning Rank and Points based on a field value

7. Openfile based on value in a field

8. Learning value of identity field on SQL Server 7 after ADO-based insert

9. ActiveWorkbook.SaveAs (Filename As Variant)

10. determining filenames of gifs created with SaveAs Web Page

11. Controlling SaveAs filename

12. PICKING UP SAVEAS FILENAME

 

 
Powered by phpBB® Forum Software