Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Can someone translate from word.basic to word.application for me??
I have a mailmerge program (actually written in FoxPro) that stopped working
in Office 2003. I think I need to rewrite b/c it uses word.basic. Is there anyone that can translate my code into the word.application object? I think this is what I need to use? ************************************************** **** oWord = CREATEOBJECT("word.basic") oWord.AppMinimize(1) oWord.FileOpen("decision.doc") oWord.MailMergetoDoc oWord.WindowList(1) oWord.AppMaximize('Microsoft Word') oWord.FileClose(2) ************************************************** ***** This is all the code! Any help would be appreciated. Thank you! |
#2
|
|||
|
|||
Something along the following lines:
Dim oWord As Word.Application Dim oDoc As Word.Document Set oWord = CreateObject("Word.Application") With oWord .WindowState = wdWindowStateMinimize Set oDoc = .Documents.Open("decision.doc") With oDoc.MailMerge .Destination = wdSendToNewDocument .Execute ' Pause:=something End With ' The Active Document is now the newly created document ' If you want that, you may not need any code, or maybe: .ActiveWindow = ActiveDocument.ActiveWindow ' and to close the mail merge main document, try oDoc.Close savechanges:=wdDoNotSaveChanges ' if you want the mail merge main document,. try '.ActiveWindow = oDoc.ActiveWindow .WindowState = wdWindowStateMaximize Set oDoc = Nothing End With Set oWord = Nothing However, it may not be the fact that it is Word basic that is preventing it from working. At least one other possibility is that documents with mail merge dta sources attached will not open correctly when you try to open them programmatically because of a new security "feature" which requires you to set up a new registry entry - see http://support.microsoft.com/default...b;en-us;825765 Peter Jamieson "KZeeh" wrote in message ... I have a mailmerge program (actually written in FoxPro) that stopped working in Office 2003. I think I need to rewrite b/c it uses word.basic. Is there anyone that can translate my code into the word.application object? I think this is what I need to use? ************************************************** **** oWord = CREATEOBJECT("word.basic") oWord.AppMinimize(1) oWord.FileOpen("decision.doc") oWord.MailMergetoDoc oWord.WindowList(1) oWord.AppMaximize('Microsoft Word') oWord.FileClose(2) ************************************************** ***** This is all the code! Any help would be appreciated. Thank you! |
#3
|
|||
|
|||
OK, I tried the registry thing and it did not change my error. I am going to
fool with the word.application object and see what I can come up with. Thanks so much for the help! "Peter Jamieson" wrote: Something along the following lines: Dim oWord As Word.Application Dim oDoc As Word.Document Set oWord = CreateObject("Word.Application") With oWord .WindowState = wdWindowStateMinimize Set oDoc = .Documents.Open("decision.doc") With oDoc.MailMerge .Destination = wdSendToNewDocument .Execute ' Pause:=something End With ' The Active Document is now the newly created document ' If you want that, you may not need any code, or maybe: .ActiveWindow = ActiveDocument.ActiveWindow ' and to close the mail merge main document, try oDoc.Close savechanges:=wdDoNotSaveChanges ' if you want the mail merge main document,. try '.ActiveWindow = oDoc.ActiveWindow .WindowState = wdWindowStateMaximize Set oDoc = Nothing End With Set oWord = Nothing However, it may not be the fact that it is Word basic that is preventing it from working. At least one other possibility is that documents with mail merge dta sources attached will not open correctly when you try to open them programmatically because of a new security "feature" which requires you to set up a new registry entry - see http://support.microsoft.com/default...b;en-us;825765 Peter Jamieson "KZeeh" wrote in message ... I have a mailmerge program (actually written in FoxPro) that stopped working in Office 2003. I think I need to rewrite b/c it uses word.basic. Is there anyone that can translate my code into the word.application object? I think this is what I need to use? ************************************************** **** oWord = CREATEOBJECT("word.basic") oWord.AppMinimize(1) oWord.FileOpen("decision.doc") oWord.MailMergetoDoc oWord.WindowList(1) oWord.AppMaximize('Microsoft Word') oWord.FileClose(2) ************************************************** ***** This is all the code! Any help would be appreciated. Thank you! |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can I translate an english word to arabic in word2003 | Microsoft Word Help | |||
how can I translate an english word to arabic in word2003 | Microsoft Word Help | |||
Translate Entire document is non-selectable in Word 2002? | Microsoft Word Help | |||
How do i translate text from English to Gujarati using word | Microsoft Word Help | |||
how do you translate languages that you don't know? | Microsoft Word Help |