Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

take out spaces in path

Posted on 1999-01-29
2
Medium Priority
?
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 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