Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-15-2016, 08:33 AM
jheymann jheymann is offline Create MID function for Word using VBA? Windows 10 Create MID function for Word using VBA? Office 2013
Novice
Create MID function for Word using VBA?
 
Join Date: Aug 2016
Posts: 1
jheymann is on a distinguished road
Default Create MID function for Word using VBA?

We are using mail merge to create documents using fields from a database. We want to be able to show only a portion of the field (for example, the left three characters). For reasons beyond the scope of this discussion, we can't do this in the database, prior to sending the merge fields to Word.

Is it possible to use VBA to create the equivalent of a MID() function for word, so that I can use a reference something like {mid( mergefield, 1, 3) }?

I've never done anything with VBA, but according to what I've seen, it is mostly designed to be invoked by user actions, not by function calls in the text. Before I spend a lot of time trying to learn how to use VBA, I thought I would ask the experts if what I wanted to do was even possible.

If it isn't possible, can anyone think of another way to accomplish the goal (IE, in a merge field reference in word, somehow limit the resulting text to the first 3 characters)?



Thank you.
Reply With Quote
 

Tags
user defined functions



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create MID function for Word using VBA? Restrict Editing function disable insert textbox function IanM_01 Word 5 11-21-2015 02:29 AM
Create MID function for Word using VBA? #REF! Error in calling VBA function disappears when function is copied lcaretto Excel Programming 2 05-26-2014 07:19 PM
Creating a graph for Future Value function (FV function) bmoody Excel 2 11-06-2013 10:52 AM
Create MID function for Word using VBA? Word VBA: How to create a command button and trigger a function? tinfanide Word VBA 2 12-02-2011 05:51 AM
Is there a function on MS Word showing the lastest changes made on a word file? _____ Word 2 10-30-2010 05:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft