A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

I need form that will give users access to word docs.



 
 
Thread Tools Display Modes
  #11  
Old January 18th, 2007, 03:48 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default I need form that will give users access to word docs.

I am at a very large defense contractor. We have security people who watch
the security people
--
Dave Hargis, Microsoft Access MVP


"Douglas J. Steele" wrote:

Wow. Surprising I'm not being hit by that, given how overly paranoid we are
about security!

Another approach is to use Automation.

Instantiated an instance of the Word application, then open the file:

Dim objWord As Object

Set objWord = CreateObject("Word.Application")
objWord.Documents.Open "C:\Folder\File.doc"
objWord.Visible = True


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Klatuu" wrote in message
...
Douglas,
FYI, In some corporate environments (where I am now, for example), the
network security settings cause problems with FollowHyperlink. I
originally
tried using it to replace a Shell to open a newly created Excel
spreadsheet.
When I ran it, it came up with the Windows security warning you would get
if
you had your Macro Security set to Medium. I changed it to Low, but got
the
same results. I tried it on a user's computer and got the same results.

Not that the FollowHyperlink is a bad thing (I like it), but just info
those
who may encounter this.
--
Dave Hargis, Microsoft Access MVP


"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access Web" will show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...

Hi folks,

I have been asked to add a method for users to access archived and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that would allow a
user
to
update the location in a text box, then the user can identify the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!






  #12  
Old January 18th, 2007, 04:14 PM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default I need form that will give users access to word docs.


Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then letting them
select from that table, put it in the appropriate event once they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For example, if
you
want them to click on a button to invoke the dialog, put that code in the
Click event of the button.

To start in a specific folder, pass the function a value for InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...

I want to restrict it to word documents. I have changed the code at the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)", "*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to adapt the code
so
that, When the dialog box is opened, it goes straight to a specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded section (between
the
Code Start and Code End) and paste it into that module. Save the
module
(making sure you don't name it the same as any of the routines in it.)

When you want to use it, use code like the 4 lines at the beginning of
the
page (that example limits the input to Excel files only). For other
examples, see the TestIt and GetOpenFile functions included in what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...

Thanks for the link. This is a new topic for me. How does it work?
Do I
have
to use all the code? Where does it go? The instructions aren't very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access Web" will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Hi folks,

I have been asked to add a method for users to access archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that would
allow a
user
to
update the location in a text box, then the user can identify the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!












  #13  
Old January 18th, 2007, 09:20 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default I need form that will give users access to word docs.

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)", "*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then letting them
select from that table, put it in the appropriate event once they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For example,
if
you
want them to click on a button to invoke the dialog, put that code in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...

I want to restrict it to word documents. I have changed the code at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to adapt the
code
so
that, When the dialog box is opened, it goes straight to a specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded section
(between
the
Code Start and Code End) and paste it into that module. Save the
module
(making sure you don't name it the same as any of the routines in
it.)

When you want to use it, use code like the 4 lines at the beginning
of
the
page (that example limits the input to Excel files only). For other
examples, see the TestIt and GetOpenFile functions included in what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Thanks for the link. This is a new topic for me. How does it
work?
Do I
have
to use all the code? Where does it go? The instructions aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Hi folks,

I have been asked to add a method for users to access archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that would
allow a
user
to
update the location in a text box, then the user can identify
the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!














  #14  
Old January 19th, 2007, 08:35 PM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default I need form that will give users access to word docs.

I select a file and press "open" but nothing happens


"Douglas J. Steele" wrote:

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)", "*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then letting them
select from that table, put it in the appropriate event once they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For example,
if
you
want them to click on a button to invoke the dialog, put that code in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...

I want to restrict it to word documents. I have changed the code at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to adapt the
code
so
that, When the dialog box is opened, it goes straight to a specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded section
(between
the
Code Start and Code End) and paste it into that module. Save the
module
(making sure you don't name it the same as any of the routines in
it.)

When you want to use it, use code like the 4 lines at the beginning
of
the
page (that example limits the input to Excel files only). For other
examples, see the TestIt and GetOpenFile functions included in what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Thanks for the link. This is a new topic for me. How does it
work?
Do I
have
to use all the code? Where does it go? The instructions aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Hi folks,

I have been asked to add a method for users to access archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that would
allow a
user
to
update the location in a text box, then the user can identify
the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!















  #15  
Old January 19th, 2007, 08:54 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default I need form that will give users access to word docs.

Put a break point in your code, and make sure that strInputFile contains the
full path to the file.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
I select a file and press "open" but nothing happens


"Douglas J. Steele" wrote:

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)", "*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then letting
them
select from that table, put it in the appropriate event once they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For
example,
if
you
want them to click on a button to invoke the dialog, put that code
in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

I want to restrict it to word documents. I have changed the code
at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to adapt the
code
so
that, When the dialog box is opened, it goes straight to a
specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded section
(between
the
Code Start and Code End) and paste it into that module. Save the
module
(making sure you don't name it the same as any of the routines
in
it.)

When you want to use it, use code like the 4 lines at the
beginning
of
the
page (that example limits the input to Excel files only). For
other
examples, see the TestIt and GetOpenFile functions included in
what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Thanks for the link. This is a new topic for me. How does it
work?
Do I
have
to use all the code? Where does it go? The instructions aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access
Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Hi folks,

I have been asked to add a method for users to access
archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that
would
allow a
user
to
update the location in a text box, then the user can
identify
the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!

















  #16  
Old January 22nd, 2007, 09:42 AM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default I need form that will give users access to word docs.

thanks for the reply. This kind of VBA is new to me.

I inserted the break point over the last line

"Application.FollowHyperlink strInputFile"

When I click on the "open" box, it goes straight to the VBA??

"Douglas J. Steele" wrote:

Put a break point in your code, and make sure that strInputFile contains the
full path to the file.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
I select a file and press "open" but nothing happens


"Douglas J. Steele" wrote:

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)", "*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then letting
them
select from that table, put it in the appropriate event once they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For
example,
if
you
want them to click on a button to invoke the dialog, put that code
in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

I want to restrict it to word documents. I have changed the code
at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to adapt the
code
so
that, When the dialog box is opened, it goes straight to a
specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded section
(between
the
Code Start and Code End) and paste it into that module. Save the
module
(making sure you don't name it the same as any of the routines
in
it.)

When you want to use it, use code like the 4 lines at the
beginning
of
the
page (that example limits the input to Excel files only). For
other
examples, see the TestIt and GetOpenFile functions included in
what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Thanks for the link. This is a new topic for me. How does it
work?
Do I
have
to use all the code? Where does it go? The instructions aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access
Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Hi folks,

I have been asked to add a method for users to access
archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that
would
allow a
user
to
update the location in a text box, then the user can
identify
the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!


















  #17  
Old January 22nd, 2007, 11:15 AM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default I need form that will give users access to word docs.

That's correct: a breakpoint will take you to the appropriate point in the
code, and halt execution.

At that point, you can go to the Immediate Window, type

?strInputFile

(complete with the question mark) and hit Enter. The value of strInputFile
will be printed directly below what you typed. (You could also hover your
mouse over the variable name in the code window, and the value should be
shown. The advantage of doing it in the Immediate Window is that you can see
the whole value, and you can copy it into a reply)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
thanks for the reply. This kind of VBA is new to me.

I inserted the break point over the last line

"Application.FollowHyperlink strInputFile"

When I click on the "open" box, it goes straight to the VBA??

"Douglas J. Steele" wrote:

Put a break point in your code, and make sure that strInputFile contains
the
full path to the file.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
I select a file and press "open" but nothing happens


"Douglas J. Steele" wrote:

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then letting
them
select from that table, put it in the appropriate event once
they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For
example,
if
you
want them to click on a button to invoke the dialog, put that
code
in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

I want to restrict it to word documents. I have changed the
code
at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...",
_
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to adapt
the
code
so
that, When the dialog box is opened, it goes straight to a
specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded section
(between
the
Code Start and Code End) and paste it into that module. Save
the
module
(making sure you don't name it the same as any of the
routines
in
it.)

When you want to use it, use code like the 4 lines at the
beginning
of
the
page (that example limits the input to Excel files only). For
other
examples, see the TestIt and GetOpenFile functions included
in
what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Thanks for the link. This is a new topic for me. How does
it
work?
Do I
have
to use all the code? Where does it go? The instructions
aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access
Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote
in
message
...

Hi folks,

I have been asked to add a method for users to access
archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that
would
allow a
user
to
update the location in a text box, then the user can
identify
the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!




















  #18  
Old January 22nd, 2007, 11:26 AM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default I need form that will give users access to word docs.

thanks for that but I haven't explained too well.

In the code, I am not opening a specific file. When the dialog box is open
it goes to a folder where the user will click on one of three folders and
then they will open the word document. Does this make things a bit more
difficult?


"Douglas J. Steele" wrote:

That's correct: a breakpoint will take you to the appropriate point in the
code, and halt execution.

At that point, you can go to the Immediate Window, type

?strInputFile

(complete with the question mark) and hit Enter. The value of strInputFile
will be printed directly below what you typed. (You could also hover your
mouse over the variable name in the code window, and the value should be
shown. The advantage of doing it in the Immediate Window is that you can see
the whole value, and you can copy it into a reply)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
thanks for the reply. This kind of VBA is new to me.

I inserted the break point over the last line

"Application.FollowHyperlink strInputFile"

When I click on the "open" box, it goes straight to the VBA??

"Douglas J. Steele" wrote:

Put a break point in your code, and make sure that strInputFile contains
the
full path to the file.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
I select a file and press "open" but nothing happens


"Douglas J. Steele" wrote:

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then letting
them
select from that table, put it in the appropriate event once
they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For
example,
if
you
want them to click on a button to invoke the dialog, put that
code
in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

I want to restrict it to word documents. I have changed the
code
at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...",
_
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to adapt
the
code
so
that, When the dialog box is opened, it goes straight to a
specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded section
(between
the
Code Start and Code End) and paste it into that module. Save
the
module
(making sure you don't name it the same as any of the
routines
in
it.)

When you want to use it, use code like the 4 lines at the
beginning
of
the
page (that example limits the input to Excel files only). For
other
examples, see the TestIt and GetOpenFile functions included
in
what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

Thanks for the link. This is a new topic for me. How does
it
work?
Do I
have
to use all the code? Where does it go? The instructions
aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The Access
Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote
in
message
...

Hi folks,

I have been asked to add a method for users to access
archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form that
would
allow a
user
to
update the location in a text box, then the user can
identify
the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!





















  #19  
Old January 22nd, 2007, 01:39 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default I need form that will give users access to word docs.

If all you need is to allow them to select a folder, see
http://www.mvps.org/access/api/api0002.htm

How are they actually selecting the Word document they wish to open? You're
not going to be able to open it unless you have a full path to it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...
thanks for that but I haven't explained too well.

In the code, I am not opening a specific file. When the dialog box is open
it goes to a folder where the user will click on one of three folders and
then they will open the word document. Does this make things a bit more
difficult?


"Douglas J. Steele" wrote:

That's correct: a breakpoint will take you to the appropriate point in
the
code, and halt execution.

At that point, you can go to the Immediate Window, type

?strInputFile

(complete with the question mark) and hit Enter. The value of
strInputFile
will be printed directly below what you typed. (You could also hover your
mouse over the variable name in the code window, and the value should be
shown. The advantage of doing it in the Immediate Window is that you can
see
the whole value, and you can copy it into a reply)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
thanks for the reply. This kind of VBA is new to me.

I inserted the break point over the last line

"Application.FollowHyperlink strInputFile"

When I click on the "open" box, it goes straight to the VBA??

"Douglas J. Steele" wrote:

Put a break point in your code, and make sure that strInputFile
contains
the
full path to the file.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
I select a file and press "open" but nothing happens


"Douglas J. Steele" wrote:

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in
message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then
letting
them
select from that table, put it in the appropriate event once
they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For
example,
if
you
want them to click on a button to invoke the dialog, put that
code
in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input
file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

I want to restrict it to word documents. I have changed the
code
at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files
(*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input
file...",
_
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to
adapt
the
code
so
that, When the dialog box is opened, it goes straight to a
specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded
section
(between
the
Code Start and Code End) and paste it into that module.
Save
the
module
(making sure you don't name it the same as any of the
routines
in
it.)

When you want to use it, use code like the 4 lines at the
beginning
of
the
page (that example limits the input to Excel files only).
For
other
examples, see the TestIt and GetOpenFile functions
included
in
what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote
in
message
...

Thanks for the link. This is a new topic for me. How
does
it
work?
Do I
have
to use all the code? Where does it go? The instructions
aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The
Access
Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver"
wrote
in
message
...

Hi folks,

I have been asked to add a method for users to access
archived
and
current
process QA documents from the DB.

The idea that springs to mind is to create a form
that
would
allow a
user
to
update the location in a text box, then the user can
identify
the
record
and
press a button to open up the document in Word.

thanks

--
How many buildings collapsed on 9/11?

I can tell you the answer isn't 2 !!























  #20  
Old January 22nd, 2007, 02:01 PM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default I need form that will give users access to word docs.

Ah! So it isn't working because I am not including the document name. It
might be easier then to use the cascading combo method I have done for
opening the web page.

I have a lot of documents in three different folders.



"Douglas J. Steele" wrote:

If all you need is to allow them to select a folder, see
http://www.mvps.org/access/api/api0002.htm

How are they actually selecting the Word document they wish to open? You're
not going to be able to open it unless you have a full path to it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in message
...
thanks for that but I haven't explained too well.

In the code, I am not opening a specific file. When the dialog box is open
it goes to a folder where the user will click on one of three folders and
then they will open the word document. Does this make things a bit more
difficult?


"Douglas J. Steele" wrote:

That's correct: a breakpoint will take you to the appropriate point in
the
code, and halt execution.

At that point, you can go to the Immediate Window, type

?strInputFile

(complete with the question mark) and hit Enter. The value of
strInputFile
will be printed directly below what you typed. (You could also hover your
mouse over the variable name in the code window, and the value should be
shown. The advantage of doing it in the Immediate Window is that you can
see
the whole value, and you can copy it into a reply)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
thanks for the reply. This kind of VBA is new to me.

I inserted the break point over the last line

"Application.FollowHyperlink strInputFile"

When I click on the "open" box, it goes straight to the VBA??

"Douglas J. Steele" wrote:

Put a break point in your code, and make sure that strInputFile
contains
the
full path to the file.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in message
...
I select a file and press "open" but nothing happens


"Douglas J. Steele" wrote:

No.

Like

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
Application.FollowHyperlink strInputFile

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"scubadiver" wrote in
message
...

Like this?

strInputFileName = ahtCommonFileOpenSave( _
If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

I get compile errors.



"Douglas J. Steele" wrote:

If you want to open the file as soon as they've selected it, put

If Len(Dir(strInputFileName)) 0 Then
Application.FollowHyperlink strInputFileName
End If

right after the

strInputFileName = aht(CommonFileOpenSave(...)

If you're saving their selected files in a table, and then
letting
them
select from that table, put it in the appropriate event once
they've
selected it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...
I've got that worked out but where do I put

application.followhyperlink

thanks for your help

"Douglas J. Steele" wrote:

Put those lines of code wherever you want them invoked! For
example,
if
you
want them to click on a button to invoke the dialog, put that
code
in
the
Click event of the button.

To start in a specific folder, pass the function a value for
InitialDir:

strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input
file...", _
InitialDir:="C:\SomeFolder\", _
Flags:=ahtOFN_HIDEREADONLY)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote in
message
...

I want to restrict it to word documents. I have changed the
code
at
the
top
of the page to the following:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Word Files
(*.DOC)",
"*.DOC")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input
file...",
_
Flags:=ahtOFN_HIDEREADONLY)

Where do I put these four lines? Also is it possible to
adapt
the
code
so
that, When the dialog box is opened, it goes straight to a
specific
folder
(Rather than just "my documents").

Thanks


"Douglas J. Steele" wrote:

Create a new module. Copy everything from the shaded
section
(between
the
Code Start and Code End) and paste it into that module.
Save
the
module
(making sure you don't name it the same as any of the
routines
in
it.)

When you want to use it, use code like the 4 lines at the
beginning
of
the
page (that example limits the input to Excel files only).
For
other
examples, see the TestIt and GetOpenFile functions
included
in
what
you
copied into the module.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver" wrote
in
message
...

Thanks for the link. This is a new topic for me. How
does
it
work?
Do I
have
to use all the code? Where does it go? The instructions
aren't
very
clear.

Thanks

"Douglas J. Steele" wrote:

http://www.mvps.org/access/api/api0001.htm at "The
Access
Web"
will
show
you
how to allow the users to select a file (or files).

Once you know which file they want to open, use
Application.FollowHyperlink
to open it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"scubadiver"
wrote
in
message
...

Hi folks,

I have been asked to add a method for users to access
archived
and
current

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.