Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
| Search | Today's Posts | Mark Forums Read
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 4th, 2006, 07:05 AM
Registered User
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Concatenating strings of code

I am wanting to take lines of code that I have pasted from mathtype and concatenate each of the lines in word using VBA.

This is a possible example of what I might have to start with.

<annotation encoding='MathType-MTEF'>

I want it to change into
<math><semantics><mi>a</mi><annotation encoding='MathType-MTEF'></annotation></semantics></math>

and if possible remove the <math>, <semantics> and
</math>, </semantics> tags.

I don't know much about VBA but I thought that something using the trim function may be useful when applied to each line of code. Then you could stick all of the lines together.

Does anyone have any ideas? Also is it possible to make it available by a button in word, that then creates an input prompt?

It would be excellent if you could help me out

Old March 31st, 2006, 02:39 PM
Registered User
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Regarding the first question:

to change into
<math><semantics><mi>a</mi><annotation encoding='MathType-MTEF'></annotation></semantics></math>

I think there will be a paragraph mark or line break on each and every line in your document. you can simply find and replace it.

Regarding the second question

<math>, <semantics> and
</math>, </semantics> tags

Similar to the first one, just find and replace it.

For these both options try to record the macro (Goto tools -> macro -> record new macro). so that you can learn better. there are so many options available in find and replace.

if you need more help please let me know.



Similar Threads
Thread Thread Starter Forum Replies Last Post
concatenating records rashi Access VBA 9 November 6th, 2008 05:07 PM
Concatenating like records pvasudevan SQL Server 2000 35 August 14th, 2008 09:28 AM
Concatenating many XML files srivalli9 XML 4 March 30th, 2006 03:05 AM
concatenating arrays allee_man BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 August 19th, 2005 08:55 AM
Concatenating many XML files srivalli9 J2EE 0 November 12th, 2003 03:14 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.