Solved

Issues with Word merge using VB.

Posted on 2016-08-16
7
31 Views
Last Modified: 2016-09-13
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?
0
Comment
Question by:donohoe1
  • 3
  • 2
  • 2
7 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41758363
Does the VB use Word's Mail Merge facility, or is it a completely separate merge using different techniques?
0
 

Author Comment

by:donohoe1
ID: 41763095
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
 

Author Comment

by:donohoe1
ID: 41763164
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points (awarded by participants)
ID: 41763207
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
 
LVL 17

Assisted Solution

by:xtermie
xtermie earned 250 total points (awarded by participants)
ID: 41770051
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
 

Author Comment

by:donohoe1
ID: 41789620
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
 
LVL 17

Expert Comment

by:xtermie
ID: 41795666
good comments and recommendations provided
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now