Sequentially number multiple copies of a document IN DUPLICATE (NCR) using a macro
My apologies for the long subject line; it's essentially exactly what I am
looking for. I copied the example of the macro offered on the MVP site to
sequentially number a document and it worked perfectly-I've been tasked with
printing out 3,000 of them. The document will be used for Property
Management (inventory)control, but now they would like the form printed out
in duplicate, on carbonless copy paper. Is there a VBA string that I could
apply to the sequential numbering to duplicate a copy of each number?
Thanks very much in advance for any help with this. Tag: read xml file with vba Tag: 105024
disigning a form
I am designing a fill in document . i want some text fields like name to
automatically type into another text field in the latter of the same document
once filled in how do i do this? Tag: read xml file with vba Tag: 105020
How can I automatically determine a document idle time & close it
I need to write some vba code to determine a specific document's idle time
and if its more than 3 minutes it needs to save and close the document
without affecting other documents I might be working on. Tag: read xml file with vba Tag: 105016
Problems with Replace
Hello,
I'm a little bit new to Word VBA. Been working with Excel VBA for a while.
I built the following macro to delete text that had the style of
"Instructions" applied to it. The idea is for the user to execute this after
they're done filling out the document.
For the most part, it works well. There are a couple of problems however.
If the instructions are immediately followed by a table, inserted JPG, etc.
it doesn't delete the preceeding text. It could be a single space, a line of
text, whatever. The issue is when the text (styled with "Instructions")
immediately preceeds something WITHOUT a hard return, it doesn't get deleted.
Please give me some guidance. I appreciate your help.
Sub Test2()
Dim objDocumentRange As Range
Dim strTargetStyle As String
Dim strResultText As String
strTargetStyle = "Instructions"
strResultText = ""
Set objDocumentRange = ActiveDocument.Range
With objDocumentRange.Find
.Style = strTargetStyle
.MatchAllWordForms = True
.Text = strResultText
.Execute Replace:=wdReplaceAll
End With
End Sub
--
Programmer on Budget Tag: read xml file with vba Tag: 105002
Applying a paragraph style SOMEtimes wipes out bold/ital--why?
Hi all,
This is a very odd problem, much more easily explained with a sample file,
which I can email to you if you're interested.
Simply put, I'm applying a paragraph style in Word XP (2002) to various
paragraphs. The style does not apply or remove bold, italics, or underlines,
so I assumed it wouldn't affect those character styles when they're present
in the paragraphs I'm styling. Mostly, that's the case, but not always. Which
is very confusing to me!
There are three basic scenarios, and the third one does NOT act the way I
think it should:
1) I apply the style to a "Normal" paragraph with SOME bold or italics. As
expected, the bold and italics remain after the style has been applied.
2) I apply the style to a "Normal" paragraph that is ENTIRELY bold,
italicized, or both. Word XP seems to treat the bold/ital as a modification
of the "Normal" paragraph style ("Normal+Bold", say, for the whole para)
instead of being character styles. Therefore, the style I applies wipes out
the bold/ital. I guess I can see why that would happen.
3) This is the mystery. I have a row in a two-column table in which one cell
is entirely bold and one is not. I merge the two cells, then replace the
paragraph mark Word inserts with a tab, so it's all one paragraph. The
resulting paragraph consists of non-bold text, then a tab, then bold text.
Applying the style to this paragraph wipes out the bold. If I copy and paste
this paragraph outside the table, the same thing happens.
The end result is a sample file I can send in which there are two
paragraphs, one from scenario 1 and one from scenario 3. They both LOOK the
same--they're not bold until the last word. But applying the same style to
each causes bold to be kept in the first case and dropped in the second.
I know that scenario 3 is complicated, but I can't tell why the merging,
find-and-replace of the tab, etc. would cause that paragraph to behave
strangely.
Finally, to conclude this epic post, this is not limited to any particular
set of paragraphs--it happens consistently across many hundreds of pages of
material.
Anyway, the sample file is far easier to understand than this lengthy post,
so let me know if you want to see it.
Many thanks in advance--I'm afraid I really don't understand the "Paragraph
Style + Character Style" issues at all.
Ben Tag: read xml file with vba Tag: 105001
Is this possible or am I crazy?
Hi Everyone,
I work at a telephone call site. Currently we use a freeware program that
uses the Net Send command in conjunction with a database that allows us to
send instant pop up messages to individuals and preassigned groups of people.
The problem I am running into is that every time IT pushes out an update I
have to run around to apx 100 machines and reinstall the program. What I am
wondering is do any one think it would be possible to convert this to a web
page? I am a newbie to Front Page and know enough about Access to make me
dangerous. :) I do have a couple of Front Page books to help me if any one
thinks this project is even possible. What I visualize is a drop down box to
select recipients an input area for the message and a button when clicked
would send the message.
Any ideas would be greatly appreciated.
Have a GREAT day and weekend everyone!!!
Deb Tag: read xml file with vba Tag: 104999
"Save-as" to docm format
I placed the 'save as' command on my customize toolbar so I could select the
default format easily. I also set my default save option to the macro
enabled. When I click the customize dropdown and select the default file
type, it comes up as a .docx format. I am trying to automate this somewhat
to go through a whole series of files and I don't see a batch conversion
wizard.
--
Del Jackman
Civil Engineer
Mankato, MN Tag: read xml file with vba Tag: 104996
Convert footnotes to ordinary text
Hello,
I have a large document with several hundred footnotes. I'm looking
for a code to replace the footnote reference with the actual footnote
text. Any ideas on where to start?
--
Fredrik E. Nilsen Tag: read xml file with vba Tag: 104991
Missing ComboBox Combination
Hello
I have a User form created is VBA
I have a combo box and it does not work below are all the codes for this
combobox
Private Sub ComboBox2_Change()
' enter value to unload combo box 2
ActiveDocument.FormFields("Text84").Result = ComboBox2.Value
Private Sub UserForm_Initialize()
ComboBox1.ColumnCount = 1
'Load data into ComboBox
ComboBox1.List() = Array("offer", "renew")
ComboBox2.List() = Array("New", "Expired", "Scheduled to Expire")
ComboBox3.List() = Array("Pricing Specialist", "Senior Pricing Specialist")
End Sub
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("Text71").Range _
.InsertBefore TextBox1
.Bookmarks("Text72").Range _
.InsertBefore TextBox2
.Bookmarks("Text84").Range _
.InsertBefore ComboBox2
.End With
UserForm1.Hide
When I test the form and I get to the comboBox2 and I select an option I get
the error message
Run-Time error "5941':
The requested member of the collection does not exist.
when I click debug the following is highlighted
Private Sub ComboBox2_Change()
' enter value to unload combo box 2
ActiveDocument.FormFields("Text84").Result = ComboBox2.Value
Please How do I correct this? I have tried to no avail thanks Tag: read xml file with vba Tag: 104990
Master -Sub documents
Hi
I am trying to create a set of master/subdocuments. The source files are on
my network drive.
I create the first document, and then goto Outline and insert a subdocument.
However when i view this is appearing as a link rather than displaying the
doucment itself.
if I do the same on my laptop, i can see the subdocument.
Can someone tell me what I'm doing wrong?
Thanks
Alexey Tag: read xml file with vba Tag: 104985
Pathname for IncludeText for server file -network disk
IncludeText for Word 2003 needs a pathname to define where the file is.
It works well (with the double \\'s) if the file is on the originating PC.
Does not work if on Networked Disk.
Looking at DocProperties & Explorer, etc. only gives
"\\Server\documents\filename
But doesn't \Network or something need to be prefixed too ?
Or maybe 3 \\\'s or something ?
Or maybe C:\\Users\\owner\\Desktop\\Network\\Server\\documents\\filename...
ALL examples show as C: ... etc. So maybe C:\Network\Server... or
similar ? Tag: read xml file with vba Tag: 104980
Auto Filling Headers
I am creating a template for memo's and other transmittals and need to come
up with a way to make whatever is written in the subject, project, and date
fields at the top of the document to auto populate in the header of each
subsequent page.
I have a feeling this will be accomplished with bookmarks and REF fields,
but beyond that I am completely stumped.
Thanks for the help. Tag: read xml file with vba Tag: 104977
Font showing smaller
I have this strange problem.
Of a set of 5 identical textboxes (there are each other's copies) 2 show a
smaller font when the form is active.
The font used is Tahoma normal 8pt, but it shows as 6-7pt.
Deleting one and copying a correct one does not change this effect.
Is looks the same as the 8pt boxes when I change the font to 9pt.
I ran the form on mutiple PC's, same result.
Can't figure it out. Tag: read xml file with vba Tag: 104969
text box info depending on what is selected in a dropdown
Hi there, this is my first post.
I have to change my company's letterhead. At the moment it is on a
basic word template so the secretary just has to type her boss' name
next to the "please ask for" but my boss wants to change it so that
each manager's direct dial number is shown underneath their particular
name, so i've started a userform but am at a loss for what to do
now!!
I was wondering if i could create a dropdown or combo box that shows
each manager and then depending on whoever gets selected, their
individual direct dial will show up in a text box? I have had a scout
round the groups but to be honest, i am really not sure how to go
about this.
Sorry if this has already been asked - as i said, i have searched the
groups but cant really see anything.
Any help would be most appreciated Tag: read xml file with vba Tag: 104964
Determining length of line
Word 2000
I want to use something other than the 3 characters provided as tab
leader options.
As an old C programmer, I outlined the algorithm I would use, but
don't know if VBA has the right methods.
If a method could return the 'length' of a line of text using a
variable width font and then subtract that from the total length
available (left margin to the leader tab), you could then divide that
length by the width of my leader character to determine how many to
insert.
I am just thinking out of the box ;-)
I imagine VBA can tell me the number of characters in a line, but for
a non-fixed-width font, that won't help. I need it in pixels, or
points, inches or some other "real" unit.
Then it would need to iterate through each line of the selection and
do the actual replacement.
Possible? Tag: read xml file with vba Tag: 104963
Creating, Populating, and Using a 2-dimensional array
I used to write in VB quite a bit (back in the 90s) but haven't had occasion
to write anything in a while. Now I am trying to get my head back in the
game. After surmounting the loss of Application.FileSearch with six hours of
frustration until I found the Dir() command I thought I would ask a basic
question prior to jumping into the frustration again.
I have a set of files (143) that I have created using VB and three
templates. The files are all named cryptically, for example:
A26Checklist.doc
A27Studyoutline.doc
B01checklist.doc
B02checklist.doc
B03studyoutline.doc
What I would like to do is cycle through the 143 files in the folder, open
each one, take the first three characters of the document name, fill a
variable with a text string based on the first three characters, do a little
searching and replacing with the text string, and then close the document in
question.
I know how to cycle through the files using Dir(pathname & "*.doc). I know
how to use the Mid() command to get my text strings out of the doc.name. I
know how to do the searching and replacing once I have the text string in
variable. But for some reason my aging brain isn't getting the right code
for setting up and populating the array.
I tried to get around the question by just creating a giant "Select Case"
statement, but unfortunately VB won't let me do that inside of the
"For...Next" loop that I wanted to do to go through the Dir()'s.
The 3-character names and text strings all are unique:
A26 = "EmergencyResponse"
A27 = "Board Operation"
B01 = "Unit Overview"
B02 = "Unit Utilities"
B03 = "Tank Gauging"
This seems to be a natural two-dimensional array. The question is how do I
define it and populate it? Then how do I get VB to give me, for example,
"Tank Gauging" for the B03 code?
I did a lot of searching in the internet before I thought to come look into
Microsoft's online community. So perhaps I am just frustrated and should
read all the strings in here.
I would appreciate any help.
Bill Dannenmaier Tag: read xml file with vba Tag: 104961
programme fucntioning problems
number,x, from cell A3 and a positive integer, n, from cell B3 then
returns into cell C3 the value of x raised to the power n divided by
n factorial.
where x in cell a3 = 2 and n in cell b3 = 5
im using this formula, but when i run it nothing happens, how do i
make this vba programme run and return the value?
the vba programmes is ok its just no running anything or doing
anything
to my spreadsheet when i need it to return into cell C3
i think i need to delcare the vaiables, but not sure how to doo it.
basically i need help in order for my spreasheet of the numbers x and
n to return in cell a3 the value of x raised tot he power n divided by
n factorial but nothin is happening in the spreadhseet, can any one
tell me or show me how to do this
please i really want to do this, but cant
this is the vba programme:
Public Function MyFunction(X As Double, N As Long) As Variant
If (N <= 0&) _
Then
MyFunction = "N must be an integer greater than zero"
Else
MyFunction = (X ^ N) / WorksheetFunction.Fact(N)
End If
End Function Tag: read xml file with vba Tag: 104960
Word Count Macro
I need to write a macro to count words according to my own needs:
Any set of characters (A-Z,a-z,0-9) with white space on either side,
including first and last word, excluding XHTML tags and hyphens.
I'm new to macros and would appreciate any help in doing this.
Thanks in advance. Tag: read xml file with vba Tag: 104957
Escape key won't stop me macro!
In either Word or Excel, the escape key won't work when my macros are
running to break into them. Maybe I've disabled it somehow (but it
works for all other purposes). I've got a Toshiba Satellite laptop.
Can anyone help? Tag: read xml file with vba Tag: 104956
Create references to template files
Hi
We currently have a template (add-in) that runs when Word starts. It creates
some new menus and shortcuts to other templates. A lot of our templates
contain a AutoNew macro which does the same in all the templates. I would
like to insert the AutoNew code in one template file and the call the code
from all the other files.
The only way I can see how to make a reference is in the Visual Basic editor
under Tools -> References. But it seems to be a static reference I create,
and I want to place the template containing all the macros in each users
folder.
The big question is....... Is there another way to create the references,
i.e. with a function?
Best regards
Lasse Tag: read xml file with vba Tag: 104953
Changing Page Orientation Within a Document
Hi All,
Do anyone know that there is any way to change the page orientation within a
document, say, page 1 is Landscape and page 2 is Portrait by C# coding??
Thanks.
Leo Tag: read xml file with vba Tag: 104952
shortcut or macro for "Paste Unformatted Text"
I would like to create either a keyboard shortcut or a macro for Paste>Paste
Special>Unformatted Text. The problem I have is that when I get to the
command, I cannot stop the macro recorder; hence, when I play the macro it
doesn't work.
I'd like to do the same thing for "add entry to autocorrect." In Word 2003 I
had keyboard shortcuts for both of these and they saved me lots of time. Tag: read xml file with vba Tag: 104949
Checking for the existence of a Macro
Here's a curly one for you all!
I have a series of standard 'office practice' type templates (Fax, Letter,
Memo, etc.) all of which contain code for creating the document in the first
place. This code saves the input in document variables to allow the code to
be rerun should the user get to the end and realise they forgot something.
The rerun code works a treat - or at least it does in the one prototype
template that I've done so far. ;)
I also have a global 'toolkit' type template that's designed to make doing
some key functions easier or just make Word work like it should work: e.g.
insert/delete a landscape section without stuffing up everything; apply
bullets/numbering using the 'List' styles instead of whatever Word wants to
use; copy/reset the standard styles in a document. This works really well,
too.
But now for the tricky part...
I know I could provide access to the rerun macro in each template in a
variety of ways: add a custom button a standard toolbar or create a custom
toolbar for each template or some such. However, since I'd rather not mess
around with any of the standard toolbars (and have my Rerun Template button
get lost in the clutter) and since I don't want to create a bunch of 1-button
toolbars and since the toolkit already has a custom toolbar, what I'd really
rather do is have a button on the Toolkit toolbar for invoking the rerun
macro. But I have some concerns and questions.
First, as would be expected, if just add a button to the Toolkit toolbar for
the rerun macro in a specific template, it only works with a document based
on that particular template. And since there are 11 templates, I would have
to add 11 buttons and then trust the users (stop LAUGHING!!!) to click the
right one or try to trap errors or show/hide buttons based on the attached
template for a document... and I don't even want to think about what would
happen if there were multiple documents open... GAHHH!!!
So I reckon a better approach would be to have a macro (and associated
button) in the toolkit template that just calls the rerun macro in the
attached template. I can guarantee that the name of the macro in each
template would be the same, so that's no problem. However, I'm
concerned/unclear about: 1) how to check that the attached template does
indeed contain a rerun macro; and 2) the actual syntax for calling the macro
in the attached template.
Suggestions? Recommendations? Or have I just spent too much time with the
sheep and am now delusional to even consider it?
--
Cheers!
The Kiwi Koder Tag: read xml file with vba Tag: 104948
Drop down list size in a form
Hello,
I have a form with a drop down list with 63 entries. I found out that the
drop down in a form will only accept 25 entries. This is really a very simple
form and I was wondering if anyone has a good workaround to get more than 25
entries into a drop down list. Thank you for any help you can provide. Tag: read xml file with vba Tag: 104939
How do I lock the size of a drop down menu inserted in word?
I'm a business process SME in my industry, but an intermediate level user of
the Office tools. I'm building a mock web interface using Word 2003 and the
various forms available. Is there a way to lock the size of a drop down menu
I've inserted, (once I've sized it to fit the menu text content) without
protecting the entire form (which appears to lock down the entire document) ? Tag: read xml file with vba Tag: 104930
Need Macro to UnBold TOC
My TOC is bold and I want it unbold.
All my Headings are Character Bold (from another application) so I changed
all Heading Styles to be NOT bold so they remain bold.
But the TOC stays bold independent of the style definition of bold or not
bold.
I can manually select the TOC an unbold it but would like a macro to select
TOC an unbold it.
Thanks Tag: read xml file with vba Tag: 104927
Working with SUBs
Kinda new to writing subroutines within VBA. I didn't realize that all
the module-level variables declared in the body of the procedure are not
available to you in the SUB. I guess I have to pass any that are needed
in the SUB, as arguments? Is there another technique? Tag: read xml file with vba Tag: 104924
Macro list drop down
Hello,
I think this is a really silly question but...I have created a form and
within the form I have a text field for which I want to add a macro when a
user enters the field. So I clicked on the drop down to pick the macro and I
noticed that the way macros are listed makes no sense at all. The macros in
normal.dot are for the most part just listed by themselves, i.e. without
mentioning the module they're in. But then one of them is listed as <module
name>.<macro name>. Some of the other listings sometimes include the name of
the template, sometimes not. There seems to be no rhyme or reason to how
macros are listed. Could someone clarifiy this for me?
Thanks very much. Tag: read xml file with vba Tag: 104920
Stop Printing
Hello
In a bid for Sustainable working (reducing my companies carbon footprint)
i'm trying to limit the amount of printing done on my network.
i can block printing using VBA in Excel but i'm scoobied about how to do it
in word
any ideas ? Tag: read xml file with vba Tag: 104918
Copy commandbar from template to normal.dot
Hey,
I want to copy a commandbar from my current template to the normal.dot
template.
This has to happen when the user opens the template, so it has to be
done i VBA code.
It also have to make a check to see if the commandbar is already in
the normal.dot file.
I have seached the internet and haven't really found anything that
could solve me problem... hope that there is someone in here that has
a solution.
Mvh
Birger Tag: read xml file with vba Tag: 104913
Counting Merged Records
Hello,
I've been writing a word macro that takes 2 excel files and merges
them into 2 different documents.
What I am trying to do is to count the Records being merged and
display them in a message box.
However, where ever I put MsgBox .RecordCount, I get a message box
saying -1.
The code I am currently using is :-
Sub MergeStickers()
'
' MergeStickersMacro
' Macro recorded 3/19/2007 by GOakham
'
strFileZ = Format$(Date, "yy-mm ")
Const sFILE As String = "Fulfillment"
Const sPATH As String = "\\Server\Dir\Dir2\Dir3\"
Const sVAR As String = ""
Const sVAR2 As String = " UK"
ChangeFileOpenDirectory "\\Server\Dir\Dir2\Dir3\"
Documents.Open FileName:="New Merge Settings2.doc",
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:=sPATH & sVAR & _
Format(Now - 1, "dd-mm-yy ") & sFILE & ".csv" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="",
SQLStatement1 _
:="", SubType:=wdMergeSubTypeOther
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
LNewDOC = ActiveDocument.Name
End With
.Execute Pause:=False
End With
' Windows("New Merge Settings 2.doc").Activate
' ActiveWindow.ActivePane.VerticalPercentScrolled = 0
' Windows(1).Activate
'MsgBox ActiveDocument.Sections.Count & " Pages."
'MsgBox ActiveDocument.MailMerge.DataSource.RecordCount
''
ChangeFileOpenDirectory "\\Server\Dir\Dir2\Dir3\"
Documents.Open FileName:="New Merge Settings2.doc",
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:=sPATH & sVAR & _
Format(Now - 1, "dd-mm-yy ") & sFILE & sVAR2 & ".csv" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="",
SQLStatement1 _
:="", SubType:=wdMergeSubTypeOther
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
MsgBox "Auto Merge complete.Now put the stickers in the Printer,and
press the OK Button", vbInformation, "Phew...Finished"
End Sub
Any help would be great Tag: read xml file with vba Tag: 104909
possible to copy/fill Bookmarks with VBA dynamically ?
Hello!
My Problem is, that i have to fill a Word Document(Template) with DataBase
Data...
I Found out how to set Bookmarks in the Document and correctly fill them with
the Data from the DB.
Now the question :
Is there a way to define Bookmarks in the Template, lets say in one row in a
table
and fill this table according to the length of my DataBase data ? (Copy the
row WITH
the Bookmars and add it to the table as many times as i need it)
Cheers Martin Tag: read xml file with vba Tag: 104907
manipulating word document one character at a time
I'm moving some text around manually in a word doc using some c# (I
couldn't find a word.csharp newsgroup, please respond in vba if it
makes you feel more comfortable though).
Moving characters around a word document one character at a time is
extremely slow. Even if the document isn't visible. Can someone offer
a suggestion to speeding the below code up? I'm thinking about some
sort of way to tell Word to not process events (or something like
that) while I'm moving everything one character at a time.
Range cellRange = aDoc.Tables.Item(1).Cell(1, 1).Range;
object collapseDirection = WdCollapseDirection.wdCollapseStart;
for (int i = mergeFields.Characters.Count; i > 0; i--)
{
string character = mergeFields.Characters.Item(i).Text;
if (mergeFields.Characters.ShapeRange.Shapes.Count == 0)
{
// add this character directly to our range
object fieldText = character;
// add our field
object type = WdFieldType.wdFieldEmpty;
cellRange.Collapse(ref collapseDirection);
cellRange.Text += character;
// remove this character from its original position
object unit = WdUnits.wdCharacter;
object count = 1;
mergeFields.Characters.Item(i).Delete(ref unit, ref count);
}
}
Any help is appreciated
Thanks Tag: read xml file with vba Tag: 104898
What's the statement to invoke a macro within the active Word docu
The statement for MATLAB invokes a macro that has been
defined within the active Excel spreadsheet file
is:handle.ExecuteExcel4Macro('!macroname()'),but I can't
find the correct statement for MATLAB invokes a macro that
has been defined within the active Word document, maybe it is one of word's
externatal interface functions as ActiveX Automation Server. please
help me. Tag: read xml file with vba Tag: 104895
how to make a check box work
I have a fax cover sheet that has marco check box but I cant check or uncheck
the boxes. Please help
Thanks
JWG Tag: read xml file with vba Tag: 104894
smart-tags and hyperlinks
I need to be able to process a document and have certain text strings
recognized and turned into a hyperlink to launch an external .exe program
with that text as a parameter. This doesn't look quite possible with the
word hyperlink capability (it adds a "#" between the .exe name and the
parameter that isn't processed correctly).
Can I do this with smart-tags? Can I write the programs needed for
smart-tags in VBA or do I need to learn vb.net to do this?
Thanks.
Chip Tag: read xml file with vba Tag: 104885
macro to highlight text in carrots
Is there a macro that I could use to highlight text in carrots? I would like
the dark gray highlighting color.
For example, here is a section of the document.
<question>
<quest>Having a good attitude about school and work and feeling good about
what you achieve.</quest>
<answer>career wellness</answer>
</question>
I need everything inside the carrots to be highlighted dark gray.
Thanks. Tag: read xml file with vba Tag: 104883
Debug Macro in Word 2007
I have recorded a macro which inserts header & footer & address Autotext
entries but when I try to run it bombs on the first line & comes up with
error 'Run time error 5941 Requested member of the collection does not exist'
My autotext entries are CIMSHeader, CIMSFooter & CIMSAddress - I have no idea
what Plain Number 1 is referring to.....
I don't know anything about VB so no idea what the problem is and any help
much appreciated - code as follows
Sub CIMSInvoice()
'
' CIMSInvoice Macro
'
'
ActiveDocument.AttachedTemplate.BuildingBlockEntries("Plain Number 1"). _
Insert Where:=Selection.Range, RichText:=True
NormalTemplate.BuildingBlockEntries("CIMSHeader").Insert
Where:=Selection. _
Range, RichText:=True
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
NormalTemplate.BuildingBlockEntries("CIMSHeader").Insert
Where:=Selection. _
Range, RichText:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.AttachedTemplate.BuildingBlockEntries("Plain Number 1"). _
Insert Where:=Selection.Range, RichText:=True
NormalTemplate.BuildingBlockEntries("CIMSFooter").Insert
Where:=Selection. _
Range, RichText:=True
WordBasic.ViewFooterOnly
NormalTemplate.BuildingBlockEntries("CIMSFooter").Insert
Where:=Selection. _
Range, RichText:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.AttachedTemplate.BuildingBlockEntries("Plain Number 1"). _
Insert Where:=Selection.Range, RichText:=True
NormalTemplate.BuildingBlockEntries("CIMSAddress").Insert
Where:=Selection _
.Range, RichText:=True
NormalTemplate.BuildingBlockEntries("CIMSAddress").Insert
Where:=Selection _
.Range, RichText:=True
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.TypeBackspace
WordBasic.GoToFooter
Selection.MoveDown Unit:=wdLine, Count:=4
Selection.TypeBackspace
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub Tag: read xml file with vba Tag: 104881
Understanding IncludePicture
I have a report that pulls a button image from a specified directory, my
command: {includepicture "C\{mergefield inventory#}.jpg \*mergeformat} - this
almost works. The two problems that I have are 1) I would like to specify
the size of the box that the image is pulled into. These images are all
buttons, but when the image is pulled into the document, I have a large box
with a small image and now the table is no longer the size that I have
created it to be. Is there a way that I can draw a box and import the button
image into it?? 2) My other problem is when the report merges, I have to
refresh the document to bring in the images? Is this what I expect with a
merged report that uses the "includepicture"??
Thanks, Diane Tag: read xml file with vba Tag: 104880
Word x Access PT-BR
Pessoal preciso de uma ajuda.
Ã? o seguinte, tenho um banco de dados e gostaria de fazer uma mesclagem com
um texto, seria o seguinte: Quando eu abro o word eu digito um nome que está
cadastradro no banco de dados e o word substitui todos os campos x no texto
para com os dados referentes daquele nome no banco de dados.
Tem como fazer isso no word?
Valeu a ajuda. Tag: read xml file with vba Tag: 104879
Using ActiveDocument.GoTo in a loop
I've got a document with 3 table of contents levels and I want to
reduce this to 1 level. I know that the table of contents is defined
byTC fields in 3 consecutive paragraphs. So I want to replace the TC
field in the first paragraph by the new text, delete the TC fields in
the next 2 paragraphs, then move on to the next TC field.
It's the last part I can't figure out. I can get the contents of the
first TC field using:
Dim aRange As Range
Set aRange = ActiveDocument.GoTo(what:=wdGoToField,
Which:=wdGoToFirst, Name:="TC")
I can then make the modifications, but how would I move on to the next
TC field? I can use:
Set aRange = ActiveDocument.GoTo(what:=wdGoToField, Which:=wdGoToNext,
Name:="TC")
But how can I test if the GoTo was successful? Is there a property of
aRange I can use to loop through all the TC fields of the document
until all have been modified or deleted?
Because I'm going to delete fields, I can't use the "for each fld in
activedocument.fields" approach. Any other suggestions?
Advance thanks for any help,
John Hendrickx Tag: read xml file with vba Tag: 104878
How to link to a field in a tabel from a header? Programming or?
Hi
We have some QA documents where there is a change log in the end of the
document which consist of multiple columns and rows. e.g.
Initials, version and a change description column (3 in total)
I need to show the most resent version and the initials in the header
(automatically) since users often forget to type the initials and version in
the header - meaning inconsistent data and serious troubles with the QA
department ;)
So I imagine that I can grab the data directlly from the change log table
somehow and put it in the header - but how do I do that?
regards
--
Henry Tag: read xml file with vba Tag: 104874
PasteOptions to preserve formatting of Word 2000 document
Hi,
I'm using Word Automation to generate word document which can be opened in
Word 2000
or higer versions. I'm using Visual Studio .NET 2005 and the word 2000
related OLB, dlls to achieve this.
I'm trying to generate a master word document which is formed from 1 or more
small word documents.
The problem i'm facing is Word 2000 doesnt provide the "Paste Options" to
preserve formatting
from the source document when we copy & paste into the master document.
This can only be achieved using Word 2003. Paste Special feature in Word
2000 also not helping me to preserve all formats/styles
from the source document. Source document will be always .RTF file.
Please let me know whether there is any work around for this problem in Word
2000.
i tried all the following approaches :
1) _Application.Selection.Range.Paste(); to paste the content into the
master document,
2) Application.Selection.InsertFile to insert small word document into the
master document,
3) _Application.Selection.PasteSpecial and the parameter for DataType i
used is WdPasteDataType.wdPasteRTF.
None of them provided the intended results.
If anyone can help me in this regard, i'll be very much thankful.
Thanks in advance,
Best Regards,
Ram. Tag: read xml file with vba Tag: 104873
Word 2007 Programming?
I've been reading about some of the programming and new document types with
Office 2007.
Currently we use an addin that enables all of our templates to merge data
via DDE from the primary CRM application.
I may need to replace Office 2000 with Office 2007 and port this VBA addin
to the new Office 2007.
I'd like to know if the .Net version is capable of instantiating DDE when a
template is launched?
Can I simply port the current addin dot to Office 2007 dot by copy paste
into a new Office 2007 template? I think that the .Net version works with
the new document types and may contain the code in an assembly centrally
located; I'm hoping that the older .dot files are compatible with Office
2000 as far as the VBA is concerned are still capable of being installed in
the startup folder, any info would be helpful.
TIA Tag: read xml file with vba Tag: 104858
Using Microsoft Word 2007 with Windows pocket pc 2003
I cannot believe what I am about to relate. I have an iPaq H5555 using
Windows Mobile 2003 and I also have onto my desktop Word 2007 and I CANNOT
USE THE TWO PROGRAMS! How incredibly stupid is that? I have no problem
whatsoever using Adobe Acrobat but windows devices cannot see or open the
other program. Wow. How do I open Word 2007 documents onto my Windows Mobile
device? Do I have to buy a NEW Windows Mobile device? Or is a 'patch'
available? Tag: read xml file with vba Tag: 104856
locked for editing
Program runs fine from a removable usb drive. when run from my hard drive it
says locked for editing. Would like to know why it is locked on my drive
but not locked on removable drive.
Thanks Tag: read xml file with vba Tag: 104854
Can I modify, or create new, buttons in the quick access toolbar
I would like to create a modified version of the "print" button to the Quick
Access Toolbar in MS Word 2007 - where the modified button will trigger an
macro that I set up to print to a different tray in my printer.
What is the default location of these graphic files for the buttons, and can
I use Photoshop, for example, to create a modified version? Tag: read xml file with vba Tag: 104851
Normal frustration
Where is the Normal template?
I have looked for it many times.
Nor could I find it on a friend's PC today.
We both use XP and Word 2002.
In anticipation - thank you.
Francis Hookham Tag: read xml file with vba Tag: 104847
how to store word document content in a variable
hi,
can you pls send me the code for my below request:
how to store word document content in in a variable
Regards
Raju A Tag: read xml file with vba Tag: 104839
Form Button
Hello all, im having a little problem running a macro for e-mail automation
on a word document. When creating sheets in excel i used the option button
on the forms panel. In my version of word (2003), i can't find the form
button, only the controls 'command button'. I have assigned the 'Sub' code
for my macro to the command button but don't know how to get it to work.
Previously in excel i created the form button, right clicked and 'Assigned
macro'. Can anyone please tell me if the option on the forms toolbar does
exist? If not then how do i make it work on a Controls command button? Can
provide more detail if required. Thanks in advance
Andrewbt Tag: read xml file with vba Tag: 104835
i need to read the data in an xml file using vba to store the data in a
string. can anyone provide any code samples on doing this? Thanks in
advance.