Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Issues with Word merge using VB.

Posted on 2016-08-16
7
Medium Priority
?
60 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 77

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 77

Accepted Solution

by:
GrahamSkan earned 1000 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 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

579 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