Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

take out spaces in path

Posted on 1999-01-29
2
Medium Priority
?
323 Views
Last Modified: 2010-05-03
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
0
Comment
Question by:jerbell
2 Comments
 
LVL 1

Accepted Solution

by:
MAD012999 earned 400 total points
ID: 1471201
Try this:

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

Good Luck,
Mike
0
 

Author Comment

by:jerbell
ID: 1471202
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

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question