Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / May 2006

Tip: Looking for answers? Try searching our database.

Word 2007 Application Call Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon Richardson - 28 May 2006 22:09 GMT
I have always used the CreateObject("word.application") to call word
automatically from my applications but it doesn't seem to be working with
Word 2007.

My code is:-
       Dim WordApp As Object
       Dim WordDoc As Object
       Dim WdRead As Boolean = False
       WordApp = CreateObject("word.application")
       WordDoc = WordApp.Documents.Open(Filename:=Chr(32) & "c:\documents
and settings\simon\my documents\fmspro_data\templates\1.dot" & Chr(32),
Readonly:=WdRead)
       With WordDoc.mailmerge
           .OpenDataSource(Name:="c:\documents and settings\simon\my
documents\fmspro_data\fmsmerge.csv")
           .Execute()
       End With
       WordApp.Visible = True

An instance of Word is created but the document doesn't open and the
mailmerge fails. Does anyone know whats changed and if there is some code
that will work with Word 2000, 2003 and 2007 (if possible).

Thank you in advance.
Simon
Simon Richardson - 29 May 2006 10:50 GMT
Managed to resolve it by removing the CHR(34) bits of the filename.
Just hoping thats compatible with the previous versions of word but will
have to do some testing.
Hopefully this will help others with the same problem.

> I have always used the CreateObject("word.application") to call word
> automatically from my applications but it doesn't seem to be working with
[quoted text clipped - 21 lines]
> Thank you in advance.
> Simon

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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.