take out spaces in path

i have this code in my program
Private Sub Form_Load()
picpath = "\\computer2\photo\"
Picture1.Picture = LoadPicture(picpath & Clipboard.GetText & ".jpg")

End Sub
Here is the problem clipbard.gettext may contain blank spaces and when i try to open the picture it doesent find it
it tries to open 1       .jpg instead of 1.jpg
I have to capture 7 caracters in the clipboard cause sometime i could have 1234567.jpg
is there a way to take out these blank spaces
jerbellAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
MAD012999Connect With a Mentor Commented:
Try this:

Picture1.Picture = LoadPicture(picpath & replace(Clipboard.GetText," ", "") & ".jpg")

Good Luck,
Mike
0
 
jerbellAuthor Commented:
well i found the answer with using a loop and inst
but your is short and sweet didn't try it but will give you points since my code works
but if yours works all the better.
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.