Minggu, 30 Oktober 2011

RE: [MS_AccessPros] Re: Opening MS Word from Access

 

David-

It sounds like you've opened your database Exclusive, so Word can't get in to do
the merge.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of David Tolson
Sent: Sunday, October 30, 2011 11:15 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: RE: [MS_AccessPros] Re: Opening MS Word from Access

Hi Patrick, Good to type to you again J. When I entered the entire path in
my code, including the name of the document "\Greetings" , Word open as did
the merge letter; however, I received the following error message:

The database has been placed in a state by the user 'Admin' on machine
'David's-PC' that prevents it from being opened or locked

And then a "Data Link Properties" dialogue box opened that had 4 tabs, and
the one that was opened was "Connection." It appears to be giving me an
opportunity to place the correct user name and password in the appropriate
fields, but there is a check mark next to "Blank password". The User name is
already filled in with "Admin" but my user name for this computer is David,
so I tried David and still received the same error.

r/David

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of patrickawood
Sent: Saturday, October 29, 2011 9:35 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Opening MS Word from Access

Hi David,

The CurrentProject.Path gives you the folder in which your database resides.
You will have to enter the path in your code or you could using code:

.Documents.Open GetMyDocumentsDir & strMergeLetterName

Function GetMyDocumentsDir() As String
If gbolErrorTrapOff = False Then On Error GoTo ErrHandle

Dim strValue As String

strValue = Environ("USERPROFILE") & "\My Documents\"

GetMyDocumentsDir = strValue

ExitHere:
Exit Function

ErrHandle:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description _
& vbCrLf & "In procedure GetMyDocumentsDir"
Resume ExitHere

End Function

Kind Regards,
Patrick Wood, Access MVP
Access Easy Tips Blog
http://accesstips.wordpress.com
Microsoft Access and SQL Azure Information Center for Developers
http://gainingaccess.net/SQLAzure/AccessAndSQLAzureInfo.aspx

--- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , "djsdaddy531"
<drtolson@...> wrote:
>
> Great Day, I have a form that produces a mail merge in MS Word, it works
fine in Windows XP, but I am running Windows 7 now. I get this error when I
execute the code:
>
> This file could no be found.
> ("C\...\Greetings")
>
>
> When I click "Debug" from the error message, this is the code that is
highlighted:
>
> .Documents.Open CurrentProject.Path & strMergeLetterName
>
> The file is in My Documents, which is where I thought CurrentProject.Path
would look.
>
> If anyone can straighten me up on this, I would be greatly appreciated.
>
> Thanks in advance,
>
> David
>

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar