Issues with Word merge using VB.

We use a construction project management system called Prolog with a SQL back end.  When a contract is generated Prolog opens the appropriate document in Word 2013 and uses VB to merge data from SQL into the document.

We have Prolog and Office 2013 installed on a dedicated XenApp 6.5 server running on Windows 2008 R2.

The problem is, for some users you can see the merge taking place, but once the merge is done the document loses all the merged data and you're left with the original, un-merged document. We have already tired different versions of Office, making the user a domain admin, deleting the user's Citrix profile and letting it re-create, and logging on to the Citrix server locally, but nothing has worked thus far.

Any ideas or possible avenues to explore?
donohoe1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
Does the VB use Word's Mail Merge facility, or is it a completely separate merge using different techniques?
0
donohoe1Author Commented:
How would I be able to tell?

Below is an abridged log file of the merge:

Enter MS Word Merge Initial Process
Lock Table success in inital merging process
Update Table success in inital Merging
Begin insert_merge processing...
Move recordset to first record
Start to activate WordOLE
Assign OLE object variable
ChkDocEmpty  
Save grammer checking
Save spell checking
Turn off grammer checking
Turn off spell checking
GetMergeSet
Get login name from security manager
Get FormField count
Get objCurrentFld
Get objCurrentFld.Result
Get objCurrentFld.StatusText {Contracts.FromSignedBy}
Start process field {Contracts.FromSignedBy}
Start assign result to field
Finish assign result to field
Get objCurrentFld Bob Smith
Get objCurrentFld.Result Bob Smith
Get objCurrentFld.StatusText {Projects.Name}
Start process field {Projects.Name}
Start assign result to field
Finish assign result to field
Get objCurrentFld Window Treatments
Get objCurrentFld.Result Window Treatments
Get objCurrentFld.StatusText {ContractSchedOfValues.ItemNumber}
Start process field {ContractSchedOfValues.ItemNumber}
Get objCurrentFld ItemNumber
Get objCurrentFld.Result ItemNumber
Get objCurrentFld.StatusText
Start process field
Get objCurrentFld
Get objCurrentFld.Result
Get objCurrentFld.StatusText {ContractAlternates.Description}
Start process field {ContractAlternates.Description}
VB Error #4608:
Value out of range
MergeLinkRec Error occurs: %1
No Error.
No Error.
Error in InsertMerge :Invalid procedure call or argument
Error in InsertMerge :%1
No Error.
VB Error #4608:
Value out of range
MergeLinkRec Error occurs: %1
No Error.
No Error.
Error in InsertMerge :Invalid procedure call or argument
Error in InsertMerge :%1
No Error.
No Error.
Merging exit is in progress...
Finish whole merge process
0
donohoe1Author Commented:
Two separate users can run the exact same contract using the exact same data, and it'll work for one and not the other.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

GrahamSkanRetiredCommented:
In stand-alone mode, Word's mail merge doesn't modify the input main document. It creates other documents based on it.

However if  you aren't able to identify the processes and hence diagnose them separately then this is really best addressed as a problem via your custom application, Prolog.

That being said, I have, in the past, seen a 'Value out of range' error raised when the document to be modified reports the error , even though the erroneous value is about to be overwritten. For this reason, If the users have their own copy of the main document, try replacing one where the user is having problems with one from a user whose process is working properly.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xtermieCommented:
When Word merges the document with the data file it creates a NEW document (merged document) and the original is left with the reference fields (main mail merge document).  As far as I can tell from your description, you are not competing the merge in the cases you are left with the "unmerged" document.

Also from the log you provided you can see that:
Error in InsertMerge :Invalid procedure call or argument
Error in InsertMerge :%1

it seems that probably the fields are not inserted or the data source has been moved (or fields renamed for some users)....can you try re-linking the mail merge document with the data source and checking the fields?
0
donohoe1Author Commented:
After digging through the log files, we found for certain users the merge was erroring out when merging an empty field in the DB into the Word document. Once we removed those fields it's started working fine. We still don't know why it would never work from some user and work for others.
0
xtermieCommented:
good comments and recommendations provided
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.