Quantcast
Browsing latest articles
Browse All 106 View Live

count a string within a selected text

Hi, I would like to know a routine to select a text (from a word (Summer) to another word (Winter)) and to count a specific word (CountIt) within in (within the selected text). I wrote this but it...

View Article


Using ¿bookmarks? to fill a protected Word form

Hello I need to make a protected form with a list of 100 items numbered from 1 t 10 (item 1, item 2, item 3...), and a table with 2 rows In the row 1 I have some text fields When the user fill a...

View Article


How to loop a macro in a word document.

Hi Im new to visual basic so any help would be appreciated. I need to alter the format of some text in a word document, it goes something like this: Original Text text (123)=5.99 9.99 I need it to look...

View Article

Reading virtual COM port and import data in Excel

I want to make a device that gathers data and log it. It's a portable device that I can connect via USB and make it talk to the PC via a COM port (tried it with a terminal program). I'm not that good...

View Article

Range lowercase

Hi, im writing a macro by Microsoft Visual Basic.I wanna declare a variable (classrng) as a range, but when i write "Dim classrng As Range" the software corrects me with "Dim classrng As range" with...

View Article


preserve formatting with copy/paste in VB

Hi-- I'd like to make a program that preserves formatting in a copy and paste between word documents. Will VB do this normally? Is there an easy way to do this in VB? Thanks. Abe

View Article

Word 2007 key bindings - VBA

Hi, I have problem with KeyBindings in Word 2007. I bind diferrent funcitons to Alt+8 and Alt+* (on numeric pad). It works just fine in Word 2003. However in Word 2007 it always calls Alt+8 bound...

View Article

VBA Word Count

Hi, couple of minor problems. I wanted to help my wife with a macro that would count all the words in the document and also the number of words in bold. I can't even get to first base on this because...

View Article


Interrupting a macro

Hi all, Hoping I'm in the right place for that question. I have a macro which scans a file, word by word, inserting some sequences of characters according to some conditions. This macro must sometimes...

View Article


How to Reset ButtonName and Filters in msoFileDialogOpen?

I am using msoFileDialogOpen or msoFileDialogFilePicker to select specific files. After I use the procedure "FilePath_FolderPath_1" below, the other procedure "FilePath_FolderPath_2" gives you the same...

View Article

Set a suggested directory with vba from access

I have a form in msaccess 2003 that has a textbox field [CaseFolder] that contains a full path folder name. I have msaccess code on that form that opens Word. I would like, at that point, that when the...

View Article

Intercept Word Build-in commands using VBA ?

Hi all, In Word 2007 I'm looking to detect a manual TOC update in order to automatically turn OFF and ON Word's Review mode. For the moment, the only clues I'm aware of are based on "events catching"...

View Article

disable print option for web page

I have a word file which saved as web page. I placed following codes to disable printing for this file. If I open the file with MS Word, the codes work perfectly well. However I do not want the user...

View Article


Excel search Word docs?

Our primary data is stored in Excel 2007 workbooks, but some of our other data is stored in Word 2007 documents. Is it possible to put a macro in our Excel workbooks that uses any ADO techniques to...

View Article

SpellCheck code and Word 2007

I have used this code *forever* in my protected documents without fail. http://word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm As my company moves to Word 2007, I do expect hiccups. A customer is...

View Article


Added two fields on the form "x / y" in the top cell in a table oftwo rows in...

Hi - After many attempts, I have almost given up. Hoping to find help in here. Should have added two fields on the form "x / y" in the top cell in a table of two rows in the footer. The code below...

View Article

StyleRef problem

We generate our MS-Word 2007 documentation from an app called Author- IT (AIT). For some reason ( can't figure out why), AIT places 2 hard returns after a style we use to display the release date,...

View Article


Templates causing problems with email attachments

7 years ago I developed a series of templates for approximately 50 coworkers and have had no issues of any kind until we recently updated from Word 2000 to Word 2007. Since then, we've started to...

View Article

Stop a Find.Execute loop

Hello, This is probably easy, but I don't find the answer. Here is my macro (Office 2007). It enumerates my titles, but when reaching the last one, it loops over it again and again. I have tried the...

View Article

Increment Bookmark name?

I have an english and a spanish version of a word form. I have created a macro to check the corresponding box in spanish when the english box is checked. However, the bookmark name is hardcoded in the...

View Article

VBA to update TOC

I've written a very simple VB Word macro to update the tables of contents in a Word file but would like to extend this to include a table of tables. The document includes a Table each of Contents,...

View Article


Adding picture into activedocument shapes

Hi Everyone, I have a following code for adding bmp pictures which are named from 1 to 250, into activedocument shapes which are named from image1 to image250. It seems like I am doing something...

View Article


Default Directory

How do I change the default directory the dialog looks for the pictures in (eg. I would like the macro to look first in the folder where the document resides. Thanks!!

View Article

If...Then...ElseIf written as a Select Case Statement

Hello. Select Case Statements confuse me. The scenario - In MS Word, I have a UserForm with a listing of choices (AutoText) using OptionButtons. The choice will be inserted at a bookmark (which I can...

View Article

Macro to protect/unprotect document

I am creating a template in Word 2003 that is protected for form fields. I would like a macro to unprotect the form (retaining the data in the form fields) so that users can edit the footer. I would...

View Article


VBA Code does not work in a word document

I have vba code in a word document. I would like to use this documentwithin the office, but the problem is the code doesn't run for anyone but myself. When they open the document, the code is not...

View Article

VBA code in Microsoft word does not work

I have a word doc with vba code. The code adds columns in tables etc. The problem is, the code only works when I open it. Is there a setting that needs to be checked or unchecked in order for others to...

View Article

change colour of cell in word table following numerical input

Hi, I have a table in a questionnaire that I want to change the colour of the cell dependent upon the number input to the cell. i.e. entering a 1 will turn the cell red, 2 will turn the cell yellow and...

View Article

Runtime Error 6028

I'm adding a UserForm to a Word template. Upon submitting the form, I receive 'Runtime Error 6028 - The range cannot be deleted'. The debugger points to the following script: Private Sub...

View Article



Delete a Row in a Table with Merged cells

Hi! I am a beginner in VBA. I try to delete a row in a table, which table contains some merged cells. Is this possible? One note: the row that I try to delete does not contain merged cells. I tried to...

View Article

Selective Find and Replace in addresses

HI All I have a lot of addresses which I'm trying to tidy via search and replace in VBA. Essentially , where there is a ", " (comma space) I want to replace this with a carriage return. I use ^p to do...

View Article

Why does this -> ActiveDocument.FormFields.count equal zero?

Hi all, I've added numerous listboxes to my document using the "Control Toolbox" Toolbar. Now when I use the following VBA: Dim aDoc As Word.Document Set aDoc = ActiveDocument MsgBox...

View Article

restricting code.

anyway to have a repeating tables function in word? with bookmarks or ranges or something? such that code in one column doesn't affect another

View Article


Changing Sort

When I want to sort my lists (not numbered, but have hierarchy numbers, it will list them as follows: 1.1 1.1.1 1.1.1.1 1.2. 1.2.3.4.5 1.23.235 1.3 1.3. 1.34.24 1.5.1 1.52 Last time I checked, 23 is...

View Article

VERY URGENT!!!

I am extremely new to VBA, but I have been seeing other people's Macros andlearning, but not much. I am having a huge problem. I am working with a Requirements Tool that stores all requirement data...

View Article

Deleting cells with VBA

Hi All, I have already posted this message once, but I can't see it. If it pops up later - apologies. Can any of you gurus tell me how to select and delete a row of cells using VBa if the row is empty....

View Article


Base de données par copier/coller

Salut à tous. Je suis nouveau en vba et au forum. Mon problème est que je dispose d’un répertoire contenant plus de 600 documents Word (association estudiantine) d’une page chacun et contenant chacun...

View Article


Number to Words (urgent)

Dear Team, Good afternoon, I am using Word 2010, and every day i have to create one letter, and in that letter i have to enter Amount For example ($100.10) and need to write as (USD one hundred dollars...

View Article

[Urgent] Print Repeatedly Character at End of Paragraphs

need help from all of you guys.. i want to print (-) repeatedly at the end of my paragraph until it reach the end of line so it just looks like : Name : John ---------------------------- Birthday :...

View Article

Lost Macro that used to paste graphic as EMF, Convert to inline andresize,...

First of all, I am not a programmer. I created the missing Macro in Word 2003 using the macro recorder. Now it is gone (although my other macros in the same template are still there) and I don't have a...

View Article

Getting rid of hyperlinks

I have received a document which is choc-a-block with linked email addresses which make it hard for me to copy and paste. I don¹t need the links at all. I have created a macro which goes from one field...

View Article


Search, find and highligh multple words in one document

I work with lawyers who often times get contracts send in MSWord for review.. We are trying to find out if there is a way to put a list of words -- example "asbestos, combustibal material, body of...

View Article

Unable to set the desired column width for a table with merged cells

Hi All, I need to copy a table, the values of which are much easier computed in EXCEL; to word. I need an exact replica of the EXCEL table (i.e. I need exactly the same layout, merged cells, row...

View Article


Loops become very slow

Hi, I've copied in (below) a macro i've been working on. The gist of what it does it loops over all the tables in the documents and checks to see if the following paragraph starts with "Table: ", if it...

View Article

macro to save .csv in excel 2007 .xlsx format

Hi everybody, I am putting together a macro that requires saving a .csv spreadsheet to Excel format (.xlsx). The file has always the same structure but the name changes according to the date (it's a...

View Article


search for special character in different fonts

Hi, I have some hugh document where some text is highlighted with --> which gives an arrow in word. The character is ^0224 in the font Wingdings. Now, the document was formated with different fonts....

View Article

How do I write a loop statement to that will stop at the end of the doc?

I am doing a search on a document and need to perform some actions when the search criteria is met. I am having a problem getting the loop to stop at the end of the document. It just keeps looping. I...

View Article

For Excel Macro - what is code for move to last empty row and pastesomething

Hi I'm working through some huge Excel spreasheets. The first thing I do is press Control-F and seek '12345' to look for a given row. Once I get to that row, I basically press 'tab' until I reach the...

View Article

Word macro - to do some clipboard maths magic

Hi. I would like to be able to highlight a number and then have the macro do the following - add 90 to it So, for example, if I was to highlight '2' and click on the Macro button it would return '92',...

View Article


Macros on toolbars, because Ctrl+Letter is not helpful to me

Hey I'm using Word Macros and find them quite useful! I want to use VBA code in Excel too. It seems the underlying language is the same (I'm guessing). What bugs me is that I can't assign a macro to a...

View Article

Browsing latest articles
Browse All 106 View Live