Solved

Issues with Word merge using VB.

Posted on 2016-08-16
7
29 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
Comment Utility
Does the VB use Word's Mail Merge facility, or is it a completely separate merge using different techniques?
0
 

Author Comment

by:donohoe1
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points (awarded by participants)
Comment Utility
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)
Comment Utility
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
Comment Utility
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
Comment Utility
good comments and recommendations provided
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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 slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
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…

771 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

7 Experts available now in Live!

Get 1:1 Help Now