#1   Report Post  
Posted to microsoft.public.word.docmanagement
Curt Curt is offline
external usenet poster
 
Posts: 32
Default Macro Failure

Build a text file and do a merge from it and all is fine. In fact I did 4
options from in this manner. Now a few days later when I run the same macro
it fails. Cannot parse string. same error in all. What would change when
nothing has been changed in operation. If macro will not continue to function
how can a person lock in action so it will continue in operation.
Can rebuild macros but that shouldn't be necessary.
Any ideas help.
Thanks
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Macro Failure

Post the code?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Curt wrote:
Build a text file and do a merge from it and all is fine. In fact I
did 4 options from in this manner. Now a few days later when I run
the same macro it fails. Cannot parse string. same error in all. What
would change when nothing has been changed in operation. If macro
will not continue to function how can a person lock in action so it
will continue in operation.
Can rebuild macros but that shouldn't be necessary.
Any ideas help.
Thanks



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Curt Curt is offline
external usenet poster
 
Posts: 32
Default Macro Failure

error code 5638 could not parse query options valid query string
This has got me. Not sure if a memory problem in machine or what.
This was all built with macro recorder.
Also I could not open web site from notfication had to go around to get back
to you. All I got was a blank screen.
Thanks for assistance

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 5/24/2008 by Curtiss A. Greer
'
ChangeFileOpenDirectory "C:\Parade\"
Documents.Open FileName:="Letter.doc", ConfirmConversions:=False,
ReadOnly _
:=False, AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate _
:="", Revert:=False, WritePasswordDocument:="",
WritePasswordTemplate:="" _
, Format:=wdOpenFormatAuto
Selection.MoveDown Unit:=wdLine, count:=1
Selection.TypeParagraph
Selection.TypeParagraph
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade\ZZZ.txt", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="",
SQLStatement1 _
:=""
ActiveDocument.MailMerge.EditMainDocument
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Name_of_Entry"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Contact_Person"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Address"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"CityState"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="Zip_"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="Amount"
ActiveDocument.MailMerge.datasource.QueryString = _
"SELECT * FROM C:\Parade\ZZZ.txt WHERE ((Name_of_Entry IS NOT NULL )
AND (Contact_Person IS NOT NULL ) AND (Address IS NOT NULL ) AND (City State
IS NOT NULL ) AND (Zip_ IS NOT NULL ) AND (Amount IS NOT NULL ))" _
& ""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .datasource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
CommandBars("Control Toolbox").Visible = False
CommandBars("Stop Recording").Visible = False
End Sub




"Graham Mayor" wrote:

Post the code?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Curt wrote:
Build a text file and do a merge from it and all is fine. In fact I
did 4 options from in this manner. Now a few days later when I run
the same macro it fails. Cannot parse string. same error in all. What
would change when nothing has been changed in operation. If macro
will not continue to function how can a person lock in action so it
will continue in operation.
Can rebuild macros but that shouldn't be necessary.
Any ideas help.
Thanks




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Macro Failure

This merge issue has been kicking around in several of the Word forums. It
would cut out a lot of duplication of effort if you stuck to the one forum.
Those of us who contribute to the Word forums tend to contribute to most of
them.

As you are opening a merge document to populate it by macro, it would make a
lot more sense to simply create the merge document with the fields already
added. You can then attach your data source and complete the merge.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Curt wrote:
error code 5638 could not parse query options valid query string
This has got me. Not sure if a memory problem in machine or what.
This was all built with macro recorder.
Also I could not open web site from notfication had to go around to
get back to you. All I got was a blank screen.
Thanks for assistance

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 5/24/2008 by Curtiss A. Greer
'
ChangeFileOpenDirectory "C:\Parade\"
Documents.Open FileName:="Letter.doc", ConfirmConversions:=False,
ReadOnly _
:=False, AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate _
:="", Revert:=False, WritePasswordDocument:="",
WritePasswordTemplate:="" _
, Format:=wdOpenFormatAuto
Selection.MoveDown Unit:=wdLine, count:=1
Selection.TypeParagraph
Selection.TypeParagraph
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:="C:\Parade\ZZZ.txt",
_ ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _ AddToRecentFiles:=False,
PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _ Format:=wdOpenFormatAuto, Connection:="",
SQLStatement:="",
SQLStatement1 _
:=""
ActiveDocument.MailMerge.EditMainDocument
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=
_ "Name_of_Entry"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=
_ "Contact_Person"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=
_ "Address"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:=
_ "CityState"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range,
Name:="Zip_" Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range,
Name:="Amount" ActiveDocument.MailMerge.datasource.QueryString = _
"SELECT * FROM C:\Parade\ZZZ.txt WHERE ((Name_of_Entry IS NOT
NULL ) AND (Contact_Person IS NOT NULL ) AND (Address IS NOT NULL )
AND (City State IS NOT NULL ) AND (Zip_ IS NOT NULL ) AND (Amount IS
NOT NULL ))" _ & ""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .datasource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
CommandBars("Control Toolbox").Visible = False
CommandBars("Stop Recording").Visible = False
End Sub




"Graham Mayor" wrote:

Post the code?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Curt wrote:
Build a text file and do a merge from it and all is fine. In fact I
did 4 options from in this manner. Now a few days later when I run
the same macro it fails. Cannot parse string. same error in all.
What would change when nothing has been changed in operation. If
macro will not continue to function how can a person lock in action
so it will continue in operation.
Can rebuild macros but that shouldn't be necessary.
Any ideas help.
Thanks



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Failure lhc Microsoft Word Help 1 June 5th 07 11:17 AM
Failure to merge [email protected] Mailmerge 2 May 21st 07 09:20 PM
get data failure Curt Mailmerge 1 February 11th 07 08:58 AM
Engine Failure MegBoschetti06 Mailmerge 2 November 10th 06 07:43 AM
Failure to print Don K. Microsoft Word Help 5 January 3rd 06 02:43 AM


All times are GMT +1. The time now is 10:53 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"