FAO: Douglas J Steele

G

Guest

Doug, with respect to an earlier post on Shell command

As requested:

"C:\Program Files\Microsoft Office\OFFICE11\Wordview.exe"
"\\Mercury\Users\AshleyS\Trim Line\GU010 Body Fit 1\Body
Protection.doc#Y:\AshleyS\Trim Line\GU010 Body Fit 1\Body Protection.doc#"

Cheers
 
G

Guest

I have found the problem!
The field work_Instruction is a hyperlink but on the form the text to
display is just the name of the file i.e. Body Protection.doc.
However because it is a hyperlink VB is then putting the address of the
hyperlink after the text to display in the code. I.e. #Y:\Trim Line\GU010
Body Fit 1\....etc..."
Any thoughts or work around? As I do still need the field as a hyperlink for
other parts of the code.
 
D

Douglas J Steele

You're going to have to strip the hyperlink address part out of the data.

You should be able to use a combination of InStr and Left to do this.

Dim strFile As String

strFile = "\\Mercury\Users\AshleyS\Trim Line\" & _
Me.Work_Station & "\" & Me.Work_Instruction
strFile = Left(strFile, InStr(strFile, "#") - 1)
strShell = Chr$(34) & "C:\Program Files\Microsoft
Office\OFFICE11\Wordview.exe" & _
Chr$(34) & " " & Chr$(34) & strFile & Chr$(34)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


A. Smart said:
I have found the problem!
The field work_Instruction is a hyperlink but on the form the text to
display is just the name of the file i.e. Body Protection.doc.
However because it is a hyperlink VB is then putting the address of the
hyperlink after the text to display in the code. I.e. #Y:\Trim Line\GU010
Body Fit 1\....etc..."
Any thoughts or work around? As I do still need the field as a hyperlink for
other parts of the code.

---
Regards

Ashley Smart


A. Smart said:
Doug, with respect to an earlier post on Shell command

As requested:

"C:\Program Files\Microsoft Office\OFFICE11\Wordview.exe"
"\\Mercury\Users\AshleyS\Trim Line\GU010 Body Fit 1\Body
Protection.doc#Y:\AshleyS\Trim Line\GU010 Body Fit 1\Body Protection.doc#"

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top