Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

Writing a Word 2003 document from Access 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 24 Mar 2008 20:41 GMT
I wrote a simple program in Access 2007 VBA that creates a Word document,
takes data from the form and inserts it into the Word document.  In order to
do this, I open Word using the following:

Dim AppWord As New Word.Application
AppWord.Documents.Add "c:\templates\wordtemplates\fax.dot"
AppWord.ActiveDocument.ShowSpellingErrors = True
AppWord.Visible = True
AppWord.ActiveDocument.Bookmarks("ContactName").Range.Text =
StrConv(rst![str_FirstName] & " " & rst![str_LastName], vbProperCase)
AppWord.ActiveDocument.Bookmarks("CompanyName").Range.Text =
StrConv(rst![str_CompanyName], vbProperCase)

...and so on...

Problem is that my users absolutely "dislike" the new Word 2007 and have
been griping since I installed it.  Does anyone know (in order of
preference)...

1) if I can make Word 2007 look like Word 2003?
1) if I can use Access 2007 with Word 2003?
2) if I can use Access 2007 to create an OpenOffice document?

Thanks to anyone that can offer any input!
Douglas J. Steele - 24 Mar 2008 22:27 GMT
1. If you mean you want menus rather than the ribbon, Microsoft doesn't
offer that feature. However, there are 3rd parties out there who do. A quick
search in Google revealed
http://office.microsoft.com/en-us/marketplace/EM102220621033.aspx?CategoryID=CE0
11347481033

http://www.addintools.com/english/menuword/ and others.

2. There should be no issue using Word 2003 from Access 2007. You might want
to switch to Late Binding though, since it sounds as though you don't have
Word 2003 installed on your machine anywhere. For the code you showed, try

Dim AppWord As Object

 Set AppWord = CreateObject("Word.Application.11")
 AppWord.Documents.Add "c:\templates\wordtemplates\fax.dot"
 AppWord.ActiveDocument.ShowSpellingErrors = True
 AppWord.Visible = True
 AppWord.ActiveDocument.Bookmarks("ContactName").Range.Text =  _
   StrConv(rst![str_FirstName] & " " & rst![str_LastName], vbProperCase)
 AppWord.ActiveDocument.Bookmarks("CompanyName").Range.Text = _
   StrConv(rst![str_CompanyName], vbProperCase)

3. Couldn't tell you. If OpenOffice supports automation, then there's no
reason why you couldn't. I've used Access with WordPerfect in the past.

Signature

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

>I wrote a simple program in Access 2007 VBA that creates a Word document,
> takes data from the form and inserts it into the Word document.  In order
[quoted text clipped - 21 lines]
>
> Thanks to anyone that can offer any input!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.