Quantcast
Channel: Word VBA Beginners
Browsing all 106 articles
Browse latest View live

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


Re: Keeps asking to save/change normal.dot after I've thrown data from VB6 to...

Hi All I just can't pin this one down. I have a vb6 app that connects and throws data at a MS Word doc template that I've pre-created. The doc population works fine (ie a copy of the template is used...

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


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
Browsing all 106 articles
Browse latest View live