Solved

Issues with Word merge using VB.

Posted on 2016-08-16
7
33 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
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.

 
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 18

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 18

Expert Comment

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

778 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