how to save
Posted on 2004-11-09
i am doing a project in visual basic, in that i am using commondialog control to save a image in "jpg" format, i am sending you my code below .I am able to save the imagein "jpg" format and then retrive it in a word document with the below code.MY Problme is that i want to save the file with out the save dialogbox appearing but autometically by it self .I think by seeing the below code you may understand my requirement. i had given a comment in the code so that you can easily understand what i require.
HERE is my code that i am using
.DialogTitle = "Choose a filename to save"
.Filter = "JPEG files (*.JPG)|*.JPG"
.FilterIndex = 1
.FileName = "ima"
.ShowSave ('I dont want this but the file should be save autometicall by the above name)
If .FileName = "" Then Exit Sub
picBoard.AutoRedraw = True
picBoard.Picture = picBoard.Image
SavePicture picBoard.Picture, .FileName
'SavePicture picBoard.Picture, "c:\ima.bmp"
sh.Visible = True
sh.Documents.Open (App.Path & "\pic.doc")
sh.Selection.InlineShapes.AddPicture FileName:=App.Path & "\ima.jpg"