Repeated consecutive words
This is a multi-part message in MIME format.
------=_NextPart_000_000B_01C3A32A.AFA81CD0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_000C_01C3A32A.AFA81CD0"
------=_NextPart_001_000C_01C3A32A.AFA81CD0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
En blanco
HI:
I need a macro that find any repeated consecutive word in a Word =
document. I'm working with large document and sometimes it have (wrong) =
consecutive repeated words, and sometimes it pass the manual revision =
and the final document goes with that repeated words.
I don't need that the macro eliminates the word, just mark it and we =
decide if eliminate it or not.
Any help will be so much apreciated.
Thanks in advance,
Omar
------=_NextPart_001_000C_01C3A32A.AFA81CD0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE id=3DridTitle>En blanco</TITLE><BASE=20
href=3D"file://C:\Archivos de programa\Archivos comunes\Microsoft =
Shared\Stationery\">
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<STYLE>BODY {
MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 25px; COLOR: #000000; =
FONT-FAMILY: Arial, Helvetica
}
P.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
LI.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
</STYLE>
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY id=3DridBody bgColor=3D#ffffff=20
background=3Dcid:000601c3a343$d4f2e3d0$7ef82bc8@mipcxt400>
<DIV><FONT face=3DTahoma color=3D#008080 size=3D4></FONT> </DIV>
<P><FONT face=3D"Californian FB"></FONT></P>
<P> </P>
<P>HI:</P>
<P> </P>
<P>I need a macro that find any repeated consecutive word in a Word =
document.=20
I'm working with large document and sometimes it have (wrong) =
consecutive=20
repeated words, and sometimes it pass the manual revision and the final =
document=20
goes with that repeated words.</P>
<P>I don't need that the macro eliminates the word, just mark it =
and we=20
decide if eliminate it or not.</P>
<P>Any help will be so much apreciated.</P>
<P> </P>
<P>Thanks in advance,</P>
<P> </P>
<P> </P>
<P>Omar</P>
<P> </P></BODY></HTML>
------=_NextPart_001_000C_01C3A32A.AFA81CD0--
------=_NextPart_000_000B_01C3A32A.AFA81CD0
Content-Type: application/octet-stream;
name="Fondo de En blanco.gif"
Content-Transfer-Encoding: base64
Content-ID: <000601c3a343$d4f2e3d0$7ef82bc8@mipcxt400>
R0lGODlhLQAtAID/AP////f39ywAAAAALQAtAEACcAxup8vtvxKQsFon6d02898pGkgiYoCm6sq2
7iqWcmzOsmeXeA7uPJd5CYdD2g9oPF58ygqz+XhCG9JpJGmlYrPXGlfr/Yo/VW45e7amp2tou/lW
xo/zX513z+Vt+1n/tiX2pxP4NUhy2FM4xtjIUQAAOw==
------=_NextPart_000_000B_01C3A32A.AFA81CD0-- Tag: fonts Tag: 40624
format problems when cut/paste on letterhead doc
I have a "letterhead" document (not a template) which I
use to create letters by copying and pasting the body of
the letter onto it. With the exception of the letterhead
portion, it is blank until I copy/paste the body or
substance of the letter onto it. But when I do so, the
part that I copied requires alot of cleaning up:
incorrect font, messed up paragraphs, spacing, bold,
margins, etc. Can anyone help me so that when I copy onto
my letterhead, it will not require all this cleaning up?
Thank you very much for your assistance. (I tried to
create a template, but copying and pasting created the
same problem.)
attymusic Tag: fonts Tag: 40621
Bring Word to the front (ZOrder 0)
Hi,
I have an application which outputs RTF files to Word, which in turn runs a
macro on the open document. The problem is sometimes Word does not open in
the foreground, I need to manually select it in the task bar to bring it to
the front. How can I bring the active window in Word to the foreground
(using VBA). I've tried using the Activate method on the document's window
but it only makes it the active window in Word, it does not bring it to the
foreground. I've looked at the SetWindowPos API call but I need to pass it
the hwnd of the active window, something which to my knowledge VBA does not
provide for.
I am using Word 2000/2002 on Windows 2000.
Cheers,
John Tag: fonts Tag: 40620
Macros on a protected document
I have a global template that is loaded when Word starts up. It contains
some macros that used to work for some protected documents that have form
fields. On exiting one of the form fields, I used to run a macro, but today
that all stopped?!? I don't understand what happened. Now when I open the
template I can no longer access the macros let alone even run one.
Any ideas what I may have done?
Thanks in advance,
Chris Tag: fonts Tag: 40619
Form Fields
I am using the following code to protect a form. Is it possible that
protecting a form can set a checkbox to true?
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True,
Password:=FORM_PASSWORD
Mark Baird Tag: fonts Tag: 40615
Merging documents
I am trying to open a series of Word documents and then
merge them into one larger document.
Allis going well until I get to a document that as a
Header....this does not get merged into the one larger
document.
The process I am using is:
objDoc = Documents.Open(FileName:=strDocumentName, _
ReadOnly:=False, _
PasswordDocument:="xxx", _
WritePasswordDocument:="xxx")
objWordApp.Selection.WholeStory ' *** this is not getting
the Header
objWordApp.Selection.Copy
objWordDoc.ActiveWindow.Activate ' activate new
document
objWordApp.Selection.MoveDown Unit:=wdScreen,
Count:=2
objWordApp.Selection.InsertBreak Type:=wdPageBreak
objWordApp.Selection.Paste
Can anyone please help me?
Thanks,
Barry Tag: fonts Tag: 40612
Word Form-Field Capitalization
Is it possible to set up a Word 2002 form field such that sentences beyond
the first one entered into the field begin with a capital letter? I use
fields that contain multiple sentences not infrquently and the first letter
issue is easily tackled with the "First Capital" setting for the first
sentence only. The setting appears not to be carried through to subsequent
settings, however. Any help or pointers appreciated. Tag: fonts Tag: 40604
Invoke a macro using the last-typed word as a macro name?
I've previously asked about using an AutoCorrect entry to open a
UserForm or invoke some code. I have a feeling that this may not be
possible, but have an idea that would simulate it.
Could someone please sketch out the code for:
As I'm typing a document, instead of typing the next word in the
sentence, I type the name of a macro.
After the last character of the macro name I just typed, I press a
function key, or an Alt+SomeLetter combination.
At that time, Word deletes the previously-typed macro name from the
document and invokes a macro having the same name as the
previously-typed-but-now-erased word. (This would either insert text
at the cursor, or open a userform. The fields in the userform would
then be put into a string that would insert some canned text at the
cursor.)
If you can make any sense out of what I just wrote, please head me in
the right direction ...
TIA Tag: fonts Tag: 40598
Can I "Get *this* table and put *here*"?
I hope I can word this intelligently. I get a range from an Excel
spreadsheet and paste it as a table into Word. The Word table is then
broken into several smaller tables, based on a code group in the last
column - this is saved as its own document. Could be anywhere from 20-40
smaller tables, each of which needs to go in its corresponding place in a
report. There are actually about a hundred possible code groups.
Is there any way I can write some code for the report that will:
(A) find the code group mentioned in the paragraph preceeding the table's
place,
(B) open the document with the tables, find the right one, and paste it in,
and
(C) automatically update the report upon opening with the latest saved
tables?
Ed Tag: fonts Tag: 40597
Can an Autocorrect entry open a Userform or run VB code?
I have a situation in which the use of AutoCorrect entries are a great
advantage in typing reports.
It would be even more useful if an AutoCorrect entry could open a
UserForm and data entered in that form could be inserted into the
document.
Is that possible? Could anyone supply, or tell me where to find some
code to do that?
TIA Tag: fonts Tag: 40591
Word Save Document Macro
Hi,
i have create a Word Makro with has Events for SaveAs,
SaveAll, DocumentClose. I don't want that the user saves
the Document.
That works fine. But my question is the following:
How can i call a Makro with Events like onClose, onSave
from another Word Document? That means i have Doc1.doc and
MacroDoc.doc. Now i want to run Doc1.doc and on Startup or
CommandLine i want to call the Macros of MacroDoc.doc.
Or otherwise:
How can i add a Macro to a Word Document wich is stored in
a .bas File via CommandLine????
Thank you
Yavuz Bogazci Tag: fonts Tag: 40590
Mail Merge
I have a HP9000 with a saddle stich option which allows me
to make booklets. The limitation for a booklet is 40
pages. Currently I have a 36 page booklet that I wish to
use in a mail merge for 20 unique people. When the mail
merge is complete I end up with a document of 720 pages
(36 x 20). Now my printer will not make the booklets
because it thinks there are too many pages. How can I do
a mail merge like this and instruct the printer to start a
booklet after each 36th page??
Help. Tag: fonts Tag: 40588
Filesearch...
How can'I search the files what are including a string?
(+ Filesearch)
Tank
Juan Carlos Biancotti
jcbiancotti@QUITAESTOiespana.es Tag: fonts Tag: 40587
Merging two cells into one
I have a short macro that selects the current cell of a
table, and the one below it, and merges them both into
one cell:
Selection.MoveDown Unit:=wdLine, Count:=1,
Extend:=wdExtend
Selection.Cells.Merge
However this macro does not work when the current cell
contains text of more than one line (because of
the 'Unit:=wdLine' bit, presumably). Is there a
parameter I can use instead of wdLine? It does not seem
to accept wdParagraph or wdTableCell or anything like
that...
Steve Wylie Tag: fonts Tag: 40586
Searching a string till eof
I want to search (through VBA) a string "ABC N.N", where n may be any
number, one by one till end of Document & simoultaneously add a unique value
to it, can this be possible?
Regards,
G Bahri Tag: fonts Tag: 40577
Searching a string till eof
I want to search (through VBA) a string "ABC N.N", where n may be any
number, one by one till end of Document & simoultaneously add a unique value
to it, can this be possible?
Regards,
G Bahri Tag: fonts Tag: 40576
Searching a string till eof
I want to search (through VBA) a string "ABC N.N", where n may be any
number, one by one till end of Document & simoultaneously add a unique value
to it, can this be possible?
Regards,
G Bahri Tag: fonts Tag: 40575
Make e-mail window open without DOS window
This code opens an e-mail window, but before the e-mail window opens, a
DOS window opens and then goes away. Is there any way to have the
e-mail window open without having the DOS window open at all?
Dim RetVal
RetVal = Shell("start mailto:", vbNormalNoFocus)
Thanks,
Larry Tag: fonts Tag: 40571
Saving doc as MHTML
Hi , I am generating a Word 2003 document using VBScript
similar to the following:
' Create an instance of Word
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
' Add a new document
Set wrdDoc = wrdApp.Documents.Add
wrdDoc.PageSetup.Orientation = wdOrientPortrait
wrdDoc.Select
Set wrdSelection = wrdApp.Selection
wrdDoc.Select
' Create a string and insert it into the document
StrToAdd = "Release Note"
wrdSelection.Font.Name
= "Arial"
wrdSelection.Font.Size = 12
wrdSelection.Font.Bold = True
StrToAdd = "Build Information"
wrdSelection.ParagraphFormat.Alignment =
0 'wdAlignParagraphLeft
wrdSelection.TypeText StrToAdd
'now save it as MHTML
wrdDoc.SaveAs "C:\Temp\Dev\BuildReleaseNotes.mhtml",10
' I have also tried
wrdDoc.SaveAs "C:\Temp\Dev\BuildReleaseNotes.mhtml",8
But the resulting mhtml file is not in the correct MHTML
format, I would like to know how to emulate the Word ->
File -> Save As -> Web Archive (*.mht, *.mhtml) function
in VBScript.
Any help much appreciated.. thanks in advance
Regards
David E Tag: fonts Tag: 40566
How do I use a custom function?
This should be a simple but I cannot find the answer
anywhere in the help index.
I've created my own VB function in Word 2000 that converts
a number to text. For example, if a cell in a table holds
the number 1,234.56 it will return One thousand two
hundred and thrty four pounds 56 pence. It's called
F_AmountInWords. But I can work out how to use it in a
cell.
I've tried inserting a field with the field code
= AmountInWords (RIGHT) \* MERGEFORMAT
But it just returns "!Syntax Error,(." I gather this is
because the = function only uses built in function, but
how do I call one from Module1.
Many thanks,
Mark Tag: fonts Tag: 40561
AutoText retrieval.
I want to create a VBA routine to attach to a Word XP toolbar button which
when selected will display the AutoText entries relating only to the
template attached to the new active document.
At present I am using SendKeys in the following way to achieve the desired
result but am thinking that there must be a better method of doing this:
SendKeys "%iax" & "%l" & "LTSB Tender" & "{Enter}" & "{Tab}" & "{Enter}",
True
This simulates the reader selecting Insert|AutoText|AutoText, going to the
"Look in" field and then typing "LTSB etc" to select the appropriate
template and then completing the operation of tabbing to the OK button and
selecting it. Crude, I know. But it works. Any new results I apply will also
have to Work in Word 97 as some users are still on that version.
Could anyone help with this challenge, please?
Regards
Rod Tag: fonts Tag: 40560
First Line Prints Twice
Howdy,
Where I work, we have a problem printing to envelope printers. So we
use the code below to allow the user to select the address in the letter and
with macro tell Word to just print to the envelope without first checking to
see if there is an envelope printer present.
Sub BobEnvelopePrinter()
'
' Written by Bob
Application.ScreenUpdating = False
With activedocument.Bookmarks
.Add Range:=Selection.Range, Name:="EnvelopeAddress"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.HomeKey Unit:=wdStory
activedocument.Envelope.Insert Size:="Size 10"
activedocument.Envelope.FeedSource = wdPrinterEnvelopeFeed
activedocument.Envelope.PrintOut ExtractAddress:=True, OmitReturnAddress
_
:=False, PrintBarCode:=True, FeedSource:=True, Size:="Size 10", _
ReturnAddress:="", AddressFromLeft:=100, _
AddressFromTop:=100, ReturnAddressFromLeft:=wdAutoPosition, _
ReturnAddressFromTop:=wdAutoPosition,
DefaultOrientation:=wdLeftLandscape _
, DefaultFaceUp:=True
activedocument.Sections.First.Range.Delete
Selection.MoveRight Unit:=wdCharacter, Count:=1
Application.ScreenUpdating = True
Beep
End Sub
Now we are experiencing a new problem as we are testing a new image that
is comprised of Windows 2000 running Office 2000. Now when we use that code
above, it prints the first line of the address twice Once at the top of
the address of the envelope and once at the bottom of the address of the
envelope. I.E
Ralph Cramden
1 Bonnie Meadow Road
Portland ME 04112
Ralph Cramden
I ran the code above and stopped it just before printing the envelope. The
code properly creates a fresh section at the top of the document and formats
the paper of that new section to be an envelope. However when the
"PrintOut' command runs, the problem we see above appears on the printed
envelope. The first line prints twice.
We did not have this problem running Windows NT 4 with Office 97. When
we run Windows 2000 with Office 2000 SP1 one of the testers always gets this
lousey result. The other tester experiences the double printing
sporatically and we are still looking for a pattern regarding when it occurs
with the second tester. We use PCL 5 and tried printing to a HP8000 and an
HP8150 and got the same result.
So we are at a loss as to what would/could be the cause and how to fix it
. Any insights on this would be appreciated. If you with to reach me
directly, my address is at @juno.com with the username
bobmeister2
Bob T. Tag: fonts Tag: 40558
Preventing a user to change header/footer
I tried the VBA as found on
http://www.mvps.org/word/FAQs/Customization/ProtectWord200
0PlusHeader.htm, but I get an error on the line
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
I'm using Windows 2002 SP 2. What should I change ? Tag: fonts Tag: 40557
Output all options
Hi all,
I need to be able to output all the settings that a user has under the Tools
| Options menu. There has to be a looping mechanism that I can use to access
all the settings.
Ideas?
TIA and have a great day!
Steve Lang Tag: fonts Tag: 40556
Icon to access all macros
Is there a way to add an icon to the toolbar in Word so
that you can access ALL of your stored macros? Thanks! Tag: fonts Tag: 40550
skipping documents with a password
hi,
I need to do something with a lot of documents so i wrote
a routine which opens document after document (through
documents.open method) and correct the problem. Everything
went well until the routine opened a document which is
protected by a password. Then a dialog screen appears to
fill in the password. We want to run the macro overnight
and want to skip these documents but i cannot find any
code or possibility to do this....
does anyone have a suggestion?
Rob Tag: fonts Tag: 40544
! Merge Fields to be used in Variables
Hi,
I'm setting up a letter merge in Word and is being done
via VBA.
I want to be able to automatically save a file using a
particular field from the merged letter (a merged field).
E.g. when the user clicks on the save button, it saves it
using a concatenated string of two other variables namely
today's date and letter reference number (which also
appears on the merged letter).
Your help is greatly appreciated.
Wembly Tag: fonts Tag: 40540
plugging data into a word document
i programmatically pull data from access and shove it into
a word document.
I have been using search and replace to do this but teh
search object seems a bit weird when using wild card.
I have heard there is a better method but i have no idea
what it is.
can anyone please tell me whatteh better method is and how
do i implement it?
Sincerely
Woody Tag: fonts Tag: 40539
Bullet definition changes from W2000 to W2002
Hi,
I created a template in W2000 that is used as an Add-in. It displays a
toolbar that has a choice for "Create Doc". When the Create Doc button is
clicked, a macro runs that 1) creates a new document from Normal.dot, 2)
inserts AutoText containing the procedure format, and 3) copies all of the
styles from the add-in template into the document. This works fine in W2000.
(The client did not want to access the template via File|New.)
When I use the same add-in template in W2002, the Create Doc macro works
fine for everything except the bullet styles. They get modified within the
template itself (i.e., when I open the template in W2002, the styles now
have different tab locations). They get modified again when the macro runs
that copies the styles from the template to the document -- the bullet part
of the style definition gets stripped out. As a work-around, I added to the
macro to re-define the bullet styles after copying them into the document.
My question is why is W2002 changing the bullet style definitions and what
is a better way to fix the problem?
TIA,
Vivian Carroll Tag: fonts Tag: 40531
Thanks for the good advice...
...Not being a frequent visitor, I didn't appreciate the
sense of what you've written. Many thanks! Tag: fonts Tag: 40530
Check user who prints certain docs
Hi,
I've done a trawl through the newsgroup and have been unable to find any
help....
I have a macro which sends info to a text (.txt) file (i.e. the users
network login account number plus date & time) when a Doc is opened and/or
closed but what I would like to be able to do is send that same info but
this time would show when the file is printed out.
Can any kind soul send some VBA code which would do that (or point me in the
right direction....)
Many thanks
Johnnie Tag: fonts Tag: 40529
VBA5, Select and work with wdDialog... fields
Hi,
I am looking for a solution to select fields in an integrated Word dialog
(like wdDialogFileSummaryInfo) to set the focus to one of this fields
(Title, Author, ...) and to set the cursor to a position inside the field
text - without using 'SendKeys'.
{In UserForm-TextBoxes I would use the <textbox>.SetFocus and
<textbox>.SelStart, ... commands.}
Best regards, Joachim Tag: fonts Tag: 40527
Array not working for me...
Hi,
I'm using a doc with a table as a source to populate a
listbox on a userform.
The goal is for the user to choose a lastname from a
list, and get the corresponding address info into
variables for insertion into the doc. The table has 400+
rows and 3 columns. Col1 has Lastname, Col2 has 1st
address line, Col3 has the complete address resembling a
mailing label with CRs in it.
The last variable isn't getting set with the full
address. I tried changing the type to variant from string,
but it didn't help. The code is listed below.
Thanks in advance for any help!
Private Sub cmdCancel_Click()
frmGetAdd.Hide
End Sub
Private Sub cmdOK_Click()
Dim ListReturn As Integer
ListReturn = frmGetAdd.lstMDNames.ListIndex
ListReturn = ListReturn + 1
frmGetAdd.Hide
vAddressee = arrAddBook(ListReturn, 2)
vAddress = arrAddBook(ListReturn, 3)
MsgBox ("Addressee is " & vAddressee & vbNewLine & _
"Address is " & vAddress)
End Sub
Private Sub UserForm_Initialize()
Documents.Open FileName:="C:\documed\blanks\OSC
AddBook.doc"
With ActiveDocument.Tables(1)
Dim rcount As Integer
rcount = .Rows.Count
ReDim arrAddBook(1 To rcount, 3) As Variant
For i = 1 To rcount
arrAddBook(i, 0) = .Cell(i, 0).Range.Text
arrAddBook(i, 1) = .Cell(i, 1).Range.Text
arrAddBook(i, 2) = .Cell(i, 2).Range.Text
Next i
End With
ActiveDocument.Close wdDoNotSaveChanges
With frmGetAdd.lstMDNames
For r = 1 To rcount
.AddItem arrAddBook(r, 0)
Next r
End With
End Sub Tag: fonts Tag: 40522
HowTo get table cell value w/o CR?
Hi,
Using Word 97 in Win 98.
I'm populating a two-dimensional array with values from a
table, kind of converting the table to an array.
Documents.Open FileName:="C:\doc.doc"
With ActiveDocument.Tables(1)
Dim rcount As Integer
rcount = .Rows.Count
Dim arrAddBook(0 To rcount, 2) As String
For i = 1 To rcount
arrAddBook(i, 0) = .Cell(i, 0).Range.Text
arrAddBook(i, 1) = .Cell(i, 1).Range.Text
arrAddBook(i, 2) = .Cell(i, 2).Range.Text
Next i
End With
ActiveDocument.Close wdDoNotSaveChanges
My array values contain unwanted CRs.
Is there a way to get the text of the cell without the CRs?
P.S. Is there a better way to accomplish my goal?
Thanks!
Dave Tag: fonts Tag: 40520
Generic vs. Built-in Controls
I am working in Word 2000.
The VBA help seems to define 3 different types of controls:
1. ActiveX controls - which are beyond the scope of my question.
2. CommandBarControls - button, popup, and combobox primitives.
3. Built-In Controls - that can be modified, but are not fully exposed to
VBA
programming.
The help files inconsistently group together the command-bar controls and
the the built-in controls. For example, the "Type Property" help article
lists them together. But properties and methods are described only for the
button, popup, and combobox CommandBarControl objects.
General Question:
How do I find out the properties/methods for "built-in" controls like the
standard Styles drop-down - defined as an msoControlGraphicDropdown? How do
I copy and modify these controls?
Specific Question:
I want to create a drop-down with a limited list of paragraph styles, with
no option for the user to add to the list. Would it be easier to try to
modify the existing Styles control, or just create a drop-down of my own?
Should I create my own msoControlGraphicDropdown - can I do that? Or should
I just use button controls to build a menu?
Thanks,
Joshua Tag: fonts Tag: 40515
Problem with Word Merge
Requirement Description: - My web application has a
requirement of using a few rows of data from a .jsp page,
and Merge them into an existing Word template.
I have developed an application using JRun Application/web
server and Struts framework. I invoke the winword.exe
file from my action class and pass the command line
switches as the document filename and the macro name in
order to do a word merge process.
Runtime rt = Runtime.getRuntime ();
String[] callAndArgs =
strWordExePath,strWordTempName,"/mMacroName"};
Process child = rt.exec(callAndArgs);
child.waitFor();
The placeholders are in the template Word document. I
have built a Macro, which contains the script for invoking
the merge process with appropriate data source (.xls) file
and saves the merged document in a specific folder in the
server. Code for macro is as follows:-
Sub AutoExec()
Dim sName As String
Selection.HomeKey Unit:=wdStory
sName = ActiveDocument.Name
sName = Left(sName, Len(sName) - 9)
sPath = ActiveDocument.Path
ActiveDocument.MailMerge.OpenDataSource Name:= _
sPath & "\" & sName & ".xls" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="",
WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="Entire
Spreadsheet", SQLStatement _
:="", SQLStatement1:=""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
ActiveDocument.SaveAs FileName:=sPath & "\" & sName
& ".doc", FileFormat:= _
wdFormatDocument, LockComments:=False,
Password:="", AddToRecentFiles:= _
True, WritePassword:="",
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False,
SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
ActiveDocument.Save
ActiveDocument.Close
Application.Quit
End Sub
The word merge process works fine and I could see the
merged document in the concerned place, provided Jrun is
running as an application (Admin & Default Server would be
invoked from the Start button manually by a user every
time the server starts).
Problem: - When the above process is repeated by making
JRUN as a Service, the winword.exe hangs; instead of
continuing with the request and opening the word document
and running the macro for word merge process.
I can see winword.exe running in the Task Manager though.
We tried capturing the exception but the control never
returns back and the process never gets complete.
Is there some conflict happening with the two Applications
(JRUN and MS Word 2000) when I start using JRUN as a
service? What exactly changes when I change the Jrun from
being an Application to exist as a service? Is there a
better approach to achieve the above-mentioned objective?
I would greatly appreciate any help in this regard.
Also thanking in advance for all your time and patience in
reading this.
Warm Regards,
Nitin Tag: fonts Tag: 40506
Make an index page with hyperlinks to the index files
I want a macro to search at all documents in a dir and when finds the first
empty line then copy the above paragraph and paste it in a single document.
After that the macro must create a hyperlink from this paragraph to the file
which contain this paragraph.
I hope somebody understood wht i am trying to do.
Every document in this dir starts with a single paragraph (two or three
lines .The paragraph it's a sort description for the rest of the document)
I want to make a file with all the first paragraphs (short descriptions)
in which every paragraph will link to the apropriate file.
It's vey easy to do that manually but the files in the dir is 1600 and i
want a macro to do that fast. Tag: fonts Tag: 40504
Is it possible to save/restore individual Printout args?
For example, in the following, I'm trying to save, then restore the Print to
File option.
Doesn't seem to work.
With Dialogs(wdDialogFilePrint)
blnPrintToFile = .printtofile
.FileName = strInputFile
.prtofilename = strOutputFilePath
.printtofile = True
.Execute
.printtofile = blnPrintToFile
.Update
End With
Is there a better way to do this in VBA?
--
http://www.standards.com/; See Howard Kaikow's web site. Tag: fonts Tag: 40491
calling the "browse" dialog from with Word Macro
I have a word dialog that I wrote in Vb that displays a dialog box where
user can set the path(s) to different form letters they use. Currently the
dialog box has 5 textboxes that user can type paths into. What i would like
to do is call the "browse" dialog and return the selected path to the
textbox. Can anyone steer me to something that might help. Thanks in
advance for any ideas. BRC Tag: fonts Tag: 40486
Word XP changes font in automation
How do I force Word for Office XP to use the original font
in pasted text rather than applying its own? Normally
when you copy and paste text, the font attributes go with
the text but this isn't happening in Word for Office XP.
We have a Word automation process that has been running
without error for many years (the documents were created
in Word 95 and 97.) The process merges text under program
control and then copies and pastes the modified text into
a new blank document for printing. No changes are saved.
Most workstations run Word 97 and a few have Word 2000.
We recently added an XP workstation running Word from
Office XP. On this workstation only, the automated
documents print with a 12 point font rather than the 10
point font specified in the template. The 10 point font
is clearly available on the machine, and we've tried every
setting that seems even remotely related to try and modify
this behavior. The ONLY way we can get the automation
process to work on this machine is to copy the Normal.dot
used to create the original documents (in Word 97 format)
onto this workstation and to caution the user to NEVER,
NEVER allow Word to update it to the newer format when
they use Word interactively. If Normal.dot is updated, the
automation no longer works properly.
I thought I could simply replicate the styles used in the
older Normal.dot in the version for Word XP and have the
problem solved. However, when I open this older
Normal.dot with my copy of Word 2000, I don't see any user
defined styles at all. Tag: fonts Tag: 40485
Ruler
trying to get ruler so I can use it to set tabs. can't
get ruler to stay. only apperars while the mouse is
pointing to the line and it drops down. As soon as I move
the mouse the ruler disappears. How can I get it to stay
there? Tag: fonts Tag: 40481
Change Word Viewer Startup Default?
How can I change the startup defaults for WordView? Specifically, I'd like
it to open a document in Zoom|Fit to Page (rather than 100%) and in Full
Screen mode.
Because of the way we integrate WordView with our own application, I need
these defaults. Or if there's some way I can control WordView
programmatically when I create an instance of it, that would be acceptable
as well.
Thanks for your help,
- Joe Geretz - Tag: fonts Tag: 40480
Numerous links to Excel in Word Report
I have a 40 or so page Word report to which I've linked
about 25 charts, 10 tables (as pictures), and 75 or so
cell values, using the LINK field (ie. Paste Link
feature). Naturally, Word is working very hard to keep
all the fields automatically updated.
My question is, if I used VBA and figured out how to set
the Excel file as the source, created document variables
that held the values of the named ranges, then placed
DocVariable fields in the Word report, would that reduce
the stress on Word or would Word just have to "go
somewhere else" to handle the same workload? (I know
there's more required in VBA but I think this conveys the
general idea.)
Lesa Tag: fonts Tag: 40479
Making a doc "read-only"
I am opening word documents from Access. Certain users
need to be able to edit the doc while others cannot.
What would be the best way to handle this? Currently I
have security set up on the database so that the users
cannot get into a certain menu - and am using (long to
short)that to determine who can open the doc for
editing. I read on the knowledge base that the VBA code
doesn't work as expected and that one should use Basic -
but I am not having any problems opening the doc's and
editing them. I am using:
oApp.ActiveDocument.ReadOnly = True
where "oApp" is set to "word.application"
I have also tried using ":=" versus just "=". I have
something wrong here, but I cannot figure out exactly
what it is?! Any pointers??
Thank you all so much for your help & time! Tag: fonts Tag: 40475
WINWORD.EXE still in Task Mgr after error?
(Running Office 2000 on Win 2000) I'll test-run a macro that opens a
docment, but error out the macro before it's finished and the document
opens. After correcting the error, I'll restart the macro, but now get a
warning that the doc is locked and can only be opened Read-Only. A check of
the Task Manager shows that, even after shutting down Word, I've still got a
WINWORD.EXE process running. (I'm assuming it's calling for the
to-be-opened doc? which would be why Word says its locked?) Is there
something I can put in my code that will prevent this by totally unloading
Word if an error occurs?
Ed Tag: fonts Tag: 40473
capital letter
Hi
I need to create a userdefined bulletpoint. That is no
problem, but futhermore I need to make sure that the user
starts every sentence afterwards with at capital letter. I
can't use the build in autocorrection - I need to have the
answer i vba-code.
Thanks Tag: fonts Tag: 40467
Is there a way when choosing a font [in Word 97] to return to the previously
used font?
It always goes back to the default font.
Thanks, Eileen