[RESOLVED] get path-VBForums
Results 1 to 4 of 4

Thread: [RESOLVED] get path

  1. #1

    Thread Starter
    Lively Member elmnas's Avatar
    Join Date
    Jul 2009
    Posts
    127

    Resolved [RESOLVED] get path

    Hello people,

    I wrote this code to pick the absolute path

    PHP Code:
    StrOldPath ActiveDocument.Path
    StrNewPath 
    Left(StrOldPathInStrRev(StrOldPath"\"))
    StrOldPath = StrOldPath & "
    \"
    StrNewPath = StrNewPath 
    here is the result I recieve from the msgbox

    C:\Users\xxxx\Desktop\tester\423434\

    I need to make a variable of the number 423434

    I need to make the number in the path to a variable could somone help me out?

    Thank you in advance
    Last edited by elmnas; Aug 13th, 2014 at 03:06 AM.

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,417

    Re: get path

    I don't understand. Where is the "7411211?"

  3. #3

    Thread Starter
    Lively Member elmnas's Avatar
    Join Date
    Jul 2009
    Posts
    127

    Re: get path

    I meant of course 423434 changed in the thread too

  4. #4
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,417

    Re: get path

    you could split the path, then grab the last element of the resulting array, like:

    Code:
    dim splits() as string    'or is it "as new string" ?
    dim lastElement as string
    splits=split(activedocument.path,"/")
    lastElement=splits(ubound(splits))

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.