How to save through macro

I need help with a macro that saves me a present value Textbox1 according to a slide and add to the space and the word "test". However, if the textbox is empty, the presentation is saved by the name of the currently logged on Windows user, and add a space and the word "test".
Path to save the document: \\S1\DATA\TEST\
Thanks in advance for your help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What Office product are you using? It would seem that you're using PowerPoint, however it's not clear.

Chris BottomleySoftware Quality Lead EngineerCommented:
Does it help if you test the value ... i.e.

if activepresentation.slides(1).shapes("textbox 3").textframe.TextRange.Text = ""
    'use a default value for the textbox and Test
    ''"\\S1\DATA\TEST\" & "Default " & "Test"
    ' Use the textbox value
    '"\\S1\DATA\TEST\" & activepresentation.slides(1).shapes("textbox 3").textframe.TextRange.Text & " " & "Test"
end if

John WilsonCEO PowerPoint AlchemyCommented:
You need to clarify your question if you want an accurate answer!
Is TextBox1 a control textbox?
What version of PPT (assuming it is PPT)?
Is the textbox on the current slide when the save macro is called?
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Thomas_MeyerAuthor Commented:
To JSRWilson:

OK, the TextBox control is a TextBox1. I use MS Office 2010, use the file *.pptm - a presentation to the macro.
TextBox is not in the same slide is called when the document is saved.
Chris BottomleySoftware Quality Lead EngineerCommented:
Can you please respond in terms of my post ... it is a little impolite in that I have taken the time to respond and none of us knows if the content / assumption is relevant.

Thomas_MeyerAuthor Commented:
To Chris B.,
I'm sorry, but I was not at the computer to test your code.
 Probably I am doing some mistake, but the macro does not work. So I prepared a find attached file on the principle of how it should work.
 The first slide I Textbox1 control where you want to write some value. On the second slide I have the "end ", which has run the macro "SaveAs" and make the desired macro. Perhaps this is understandable.
 Thank you for your understanding.
Chris BottomleySoftware Quality Lead EngineerCommented:
Okay you are using an OLE text box so ...

Sub SaveAs()
If ActivePresentation.Slides(1).Shapes("TextBox1").OLEFormat.Object.Text = "" Then
    'use a default value for the textbox and Test
    MsgBox "\\S1\DATA\TEST\" & "Default " & "Test"
    ' Use the textbox value
    MsgBox "\\S1\DATA\TEST\" & ActivePresentation.Slides(1).Shapes("TextBox1").OLEFormat.Object.Text & " " & "Test"
End If

End Sub

Open in new window

John WilsonCEO PowerPoint AlchemyCommented:
See the upload. You will need to be careful that the user does not enter illegal characters for the save name
John WilsonCEO PowerPoint AlchemyCommented:
Sorry You will have change the save path as in this sample

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.