Advertisement

08.05.2008 at 08:12AM PDT, ID: 23622522
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Saving Word Document from Access 2003

Asked by hopelessinsalem in Access Coding/Macros, Microsoft Word

Tags: , ,

We have this database created when everyone had Office 2003 or earlier installed on their computers.  The code snippet that I pasted was found on this site, and modified for our use and worked flawlessly.....that is until now.

There are two users who now have Word 2007 on their computers, and thus lies the following issue:

If you look through the code, you will see where, from Access, the Word document is automatically saved with a specific file name.  This works for all users no matter what the Word Version.  However, The user with Word 2007 is the ONLY one who can further view the created word document.  It will open up just fine.  The user with Word 2003, when trying to open the word document created from the 2007 user, sees nothing but 'garble' and a window pops up with an error saying:

"File Conversion - Select the encoding that makes the document readable"

Now, if the 2003 user runs access, and creates a document, this error does not occur and is readable by both users.

I know in Word 2007, there is a SAVE AS 2003 document option, and I am wondering if there is some coding that needs to be done to correct this issue from happening?  Is there a way to check the version of Word that is open and thus run some different code to make sure that when the person with 2007 creates a new document and is saved that the 2003 people can still view the documents?

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
Private Sub RunWordTemplate_Click()
On Error GoTo Err_RunWordTemplate_Click
 
    Dim intAnswerMe As Integer
    
    'Fill in Work Order Description if blank to avoid Null error in Word
    If IsNull(Me.WODesc.Value) Or _
    Me.WODesc = 0 Then
        intAnswerMe = MsgBox("Please enter in a Work Order Description", vbOKOnly + vbInformation, "Description Needed")
        Me.WODesc.SetFocus
        Exit Sub
    End If
        
    Dim oApp As Object      'Variable for Word
    Dim sFilename As String 'Variable for Auto-Save file name
    Dim strTemplateName As String   'Variable for Word Template to be used
    Dim objWORDdoc As Object
    
    'Save Record
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    
    'Create path to Quotation Template
    strTemplateName = "\\Sharppc\ServerFiles\ProjectData\Quotations\QuotationTemp.dot"
    'Create default SaveName for New Quotation being written
    sFilename = "\\Sharppc\ServerFiles\ProjectData\Quotations\" & Me.WONum.Value & " - " & Me.CompanyName.Value & ".doc"
    
    Set oApp = CreateObject("Word.Application")
    oApp.Visible = True
    
    If Dir(sFilename) = "" Then                 'Test to see if created filename already exists
                                                'and if not, open Template to fill in date
        Set oApp = CreateObject("word.basic")   'otherwise just open that filename already
        With oApp
            
            .filenew Template:=strTemplateName
            'Set bookmarks in QuotationTemp to equal values of new Quoation Number created
            .EditBookmark Name:="quotedate", GoTo:=True
            .Insert (Format(Me.WODate, "mmmm dd, yyyy")) 'insert date of quote
            .EditBookmark Name:="quotenum", GoTo:=True
            .Insert (CStr(Me.WONum))                    'insert work order number
            .EditBookmark Name:="companyname", GoTo:=True
            .Insert (CStr(Me.CompanyName))              'insert company name
            
            'This code will make sure that if the street address has two lines, both are inserted
            If IsNull(DLookup("[CustAdd2]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'")) Or _
            DLookup("[CustAdd2]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'") = 0 Then
                .EditBookmark Name:="address", GoTo:=True   'insert Line 1 address
                .Insert ((CStr(DLookup("[CustAdd1]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'"))))
            Else
                .EditBookmark Name:="address", GoTo:=True   'insert Line 1 & 2 address
                .Insert (CStr(DLookup("[CustAdd1]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'"))) & vbCrLf & (CStr(DLookup("[CustAdd2]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'")))
            End If
            
            .EditBookmark Name:="citystate", GoTo:=True
            .Insert ((CStr(DLookup("[CustCity]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'"))) & ", " & (CStr(DLookup("[StateID]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'"))) & " " & (CStr(DLookup("[CustZip]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'"))))
            .EditBookmark Name:="custname", GoTo:=True
            .Insert (CStr(Me.Contact))
            .EditBookmark Name:="subject", GoTo:=True
            .Insert (CStr(Me.WODesc))
            .EditBookmark Name:="firstname", GoTo:=True
            .Insert (CStr(DLookup("[fName]", "ContactsTbl", "[Contact]='" & Me.Contact.Value & "'")) & ",")
            
            .filesaveas Name:=sFilename 'save Quotation with auto save name
            
        End With
        
        Else    'If filename already exists, just open the file at this point
            
            oApp.Documents.Open sFilename
            oApp.ActiveDocument.Save
            
        End If
 
Exit_RunWordTemplate_Click:
    Exit Sub
 
Err_RunWordTemplate_Click:
    MsgBox Err.Description
    Resume Exit_RunWordTemplate_Click
[+][-]08.05.2008 at 08:17AM PDT, ID: 22161766

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 08:48AM PDT, ID: 22162128

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 08:52AM PDT, ID: 22162179

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 01:30PM PDT, ID: 22164891

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 03:02PM PDT, ID: 22165569

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 04:00PM PDT, ID: 22165868

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.05.2008 at 06:15PM PDT, ID: 22166501

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 07:26AM PDT, ID: 22170558

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 07:34AM PDT, ID: 22170658

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 08:16AM PDT, ID: 22171159

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 08:20AM PDT, ID: 22171227

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 11:00AM PDT, ID: 22173042

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 11:49AM PDT, ID: 22173598

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.06.2008 at 11:56AM PDT, ID: 22173688

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Word
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: irudyk
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628