Avatar of RIAS
RIAS
Flag for United Kingdom of Great Britain and Northern Ireland asked on

savedialog box

Hello,

How do I open a save dialog box for word document to be saved in vb.net desktop app.


Cheers
.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
Éric Moreau

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RIAS

ASKER
Éric Moreau,
Cheers,but wanted it for .doc files.Is there any change in the .txt?
Éric Moreau

the save dialog won't actually save your file. It is just a way for your program to query the user for a path and a file name. If your app is specifically asking to save a Word document, you should change the Filter property:
o.Filter = "Word Document (*.doc)|*.doc"

Open in new window

RIAS

ASKER
Cheers!
Your help has saved me hundreds of hours of internet surfing.
fblack61
RIAS

ASKER
Éric Moreau,
Any changes here :

Select Case o.FilterIndex
                Case 1
                    RichTextBox1.SaveFile(o.FileName, _
                               RichTextBoxStreamType.PlainText)
                Case 2
                    RichTextBox1.SaveFile(o.FileName, _
                               RichTextBoxStreamType.RichText)
            End Select
Éric Moreau

This is my logic because my sample was saving the content of a richtextbox. What you need to use is the o.FileName which contains the full path selected by the user in the dialog box and use it in your own save mechanism