Tables--Reading them Quickly
I have a pretty fast machine (everything else I do goes at 'lightning
speed'). Yet it takes almost 20 seconds for my computer to read the 300
row/2 column table. Am I doing something inefficient with this formula?
-------snip-------------
Set otable = Selection.Tables(1)
NumRows=otable.Rows.count ' this ranges from 300 to 350
redim Name1(NumRows)
redim Name2(NumRows)
With otable
For nRow = 1 To NumRows
Name1(nRow) = .Cell(nRow, 1)
Name2(nRow) = .Cell(nRow, 2)
Next
End With
------snip--------------
What improvements are possible? Are reads from tables just inherently slow?
Thanks.
-- Ed Tag: DB connectivity in word Tag: 66322
Making an available printer Active
Hello all, I'm not quite a novice but...
I've seen the article on word.mvps.org about getting a list of all the
available printers and can get it into a ListBox without any problem.
But how do I get one of the printers from the list to be the ActivePrinter ?
I want a basic form without offering any chance to change print parameters -
just the a.m. ListBox and a button that says "Print" and will hide the form
when finished. Tag: DB connectivity in word Tag: 66320
Run a macro automatically when opening a document - how?
I'm a novice with macros and want to be able to run a macro automatically
when opening a document to execute a bunch of ASK and REF fields to capture
setup info e.g. customer name, address etc, store them in bookmarks and then
paste the data into various parts of the doc.
Is a macro the best way to do this or is there a better way? Tag: DB connectivity in word Tag: 66319
Attached template : orginal name
Hi,
I use vba to change the "attached template" value of copied documents to a
new value. However, Word changes the value to "normal.dot" if it doesn't
find the template, but it stores the original value somewhere, cause you can
see it in the document, how can I find this original value through vba ?
thanks in advance
Xavier Tag: DB connectivity in word Tag: 66313
word doc with fillin fields opens with no toolbars
Hi,
I'm using vba to open word documents using templates.
I've got a problem where if I open a document using a template that
contains fillin fields, the document opens (after the user has entered
values into the fillin fields), but with no toolbars - not even the
Menu toolbar.
However, if I open a document using a template that doesn't have the
fillin fields, the document opens and the toolbars are there.
If I manually open a document using the template containing fillin
fields, I don't get the missing toolbars problem.
The vba code I have to open the document is:
-------
Dim WordObj As Word.Application
Set WordObj = CreateObject("Word.Application")
Dim objWord As Word.Document
Dim strFile As String
strFile = "C:\Program Files\Microsoft
Office\Templates\NotificationTemplate.dot"
Set objWord = WordObj.Documents.Add(strFile)
WordObj.Visible = True
WordObj.Activate
--------
Can anyone help?
Thanks,
t. Tag: DB connectivity in word Tag: 66310
syntactical help
I'm trying to use the following method to insert a textbox into a document
and format it as I go, but I'm up against some sort of vba
compiler/syntactical problem I don't understand yet:
With ActiveDocument.Shapes.AddTextBox([orientation, position size etc])
...[various textbox class members here, e.g....]
.TextAlign = fmTextAlignCenter
.BorderStyle = fmBorderStyleNone
[etc]
End Width
But Option Explicit doesn't like that, presumeably becuase 'AddTextBox' is
returning a Shape, not a Textbox.
My first instict is to want to do something like...
With Ctype(ActiveDocument.Shapes.AddTextBox(...), TextBox)
...[compiler-friendly textbox member references]
End With
But that's vb.net, not vba. How do I get vba to let me play with what
.AddTextBox is returning as if it were a textbox while keeping Option
Explicit happy? I don't want to cheat and turn it off. Is there a
Ctype-like keyword, a different add-a-textbox method I'm not aware of? Tag: DB connectivity in word Tag: 66306
insert multiple documents into document retaining headers and foot
question:
I know how to insert multiple documents and an example is also in the list
below.
Only problem is that when using this method headers and footers are not
retained.
this is caused by the sameasprevious when inserting a sectionbreaknextpage
at the end of of each document.
This means that when I insert for example the second document the header and
footer of the first are being used for the second document.
This is the code from steve lang, only thing adapted is the pagebreak that
is now a sectionbreak, this is needed to keep pagesettings correct:
Sub Foo()
Dim i As Long
Application.ScreenUpdating = False
Documents.Add
With Application.FileSearch
'Search in foldername
.LookIn = "C:\test"
.SearchSubFolders = False
.FileName = "*.doc"
.Execute
For i = 1 To .FoundFiles.Count
If InStr(.FoundFiles(i), "~") = 0 Then
Selection.InsertFile FileName:=(.FoundFiles(i)), _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.InsertBreak Type:=wdsectionBreaknextpage
End If
Next i
End With
End Sub
turning off sameasprevious after inserting the doesn't help very much
because at that point the header and footer of the first document are already
used.
Maybe there is a way, that I don't know to bring them back into the previous
state
If been trying all kinds of stuff to get this to work, nothing seems to work
only thing that did work was using a maindocuments and add subdocuments to
it but this was way to slow when you need to append for example 1000
documents.
Please help me on this issue,
--
Rocco Tag: DB connectivity in word Tag: 66302
Find routine in VBA
I want to use VBA to find all the bold text in a document. When found and
still selected, copy the formatting, apply a character style called WHATEVER,
then paste the copy formatting back on top of the same text. Once that is
done, Find the next occurance. I need to do this for Italic, and Underline,
and Plain Text.
I can't use wdReplaceALL because I need the text still selected so I can
apply the character style. I can't seem to get this to work. The macro runs
forever. When I break, all the bolded text is exactly what I want (the
character style + bold) but nothing else. One time I got all but the
italics.
Dim doc As Document
Dim strFilename As String
Dim styFilename As Style
Dim rngToSearch As Range
Dim rngResult As Range
Dim f As Font
Set doc = ActiveDocument
'Capture the document name into a variable
strFilename = Left(doc.Name, Len(doc.Name) - 4)
On Error GoTo ErrorHandler
'Define a character style with no font attributes
Set styFilename = doc.Styles.Add(Name:=strFilename,
Type:=wdStyleTypeCharacter)
With styFilename
With .Font
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
End With
End With
BeginHere:
Set rngToSearch = doc.Range
Set rngResult = rngToSearch.Duplicate
'Make sure there isn't any text currently selected
If Selection.Type <> wdSelectionIP Then
Selection.Collapse _
Direction:=wdCollapseStart
End If
'Look for Bold text
Do
With rngResult.Find
.ClearFormatting
.Format = True
.Font.Bold = True
.Forward = True
.Wrap = wdFindStop
.Execute
End With
If Not rngResult.Find.Found Then Exit Do
Set f = rngResult.Font.Duplicate
With rngResult
.Font.Reset
.Style = styFilename
.Font = f
.MoveStart wdParagraph
.End = rngToSearch.End
End With
Set f = Nothing
Loop Until Not rngResult.Find.Found
'Look for Italic text
Do
With rngResult.Find
.ClearFormatting
.Format = True
.Font.Italic = True
.Forward = True
.Wrap = wdFindStop
.Execute
End With
If Not rngResult.Find.Found Then Exit Do
Set f = rngResult.Font.Duplicate
With rngResult
.Font.Reset
.Style = styFilename
.Font = f
.MoveStart wdParagraph
.End = rngToSearch.End
End With
Set f = Nothing
Loop Until Not rngResult.Find.Found
'Look for underline text
Do
With rngResult.Find
.ClearFormatting
.Format = True
.Font.Underline = wdUnderlineSingle
.Forward = True
.Wrap = wdFindStop
.Execute
End With
If Not rngResult.Find.Found Then Exit Do
Set f = rngResult.Font.Duplicate
With rngResult
.Font.Reset
.Style = styFilename
.Font = f
.MoveStart wdWord
.End = rngToSearch.End
End With
Set f = Nothing
Loop Until Not rngResult.Find.Found
'Look for plain text
Do
With rngResult.Find
.ClearFormatting
.Format = True
.Font.Italic = False
.Font.Bold = False
.Font.Underline = wdUnderlineNone
.Forward = True
.Wrap = wdFindStop
.Execute
End With
If Not rngResult.Find.Found Then Exit Do
Set f = rngResult.Font.Duplicate
With rngResult
.Font.Reset
.Style = styFilename
.Font = f
.MoveStart wdWord
.End = rngToSearch.End
End With
Set f = Nothing
Loop Until Not rngResult.Find.Found
Else
'If Response = vbNo
MsgBox ("Document will not be changed")
Exit Sub
End If
Application.StatusBar = ""
ErrorHandler:
Select Case Err.Number
'Style name already exists
Case 5173
Set styFilename = doc.Styles(strFilename)
GoTo BeginHere
End Select
End Sub
Thanks!
Caren Tag: DB connectivity in word Tag: 66301
Function DayLightSavingsTime
Any suggestions regarding a way to determine if day light savings time is in
effect.
Thanks in Advance.
--
Tim Shaffer Tag: DB connectivity in word Tag: 66299
Date format in Message
lastMod = ActiveDocument.CustomDocumentProperties("ModificationDate").Value
If MsgBox("The document modification date is " & lastMod & _
". Do you want to change" & " the document modification date
to today's date?", vbYesNo) = vbYes Then
ActiveDocument.CustomDocumentProperties("ModificationDate").Value =
Date
...
The date is shown with both Date/Time, but I want it to be displayed as a
date only. What do I need to do to get the desired format?
ModificationDate is a Custom Property of the document and is in DATE format.
Thanks in advance
Barb Reinhardt Tag: DB connectivity in word Tag: 66295
How can I remove my com addin from the Words?
I have created an Word com addin .dll with a commandBar and registered with
the Words. The problem is that every time I modified my codes, more buttons
are created on the Words commandBar list. How can I remove my com addin
from the Words?
Thanks.
--
Message posted via http://www.officekb.com Tag: DB connectivity in word Tag: 66293
How do I change the path of the Word.WdWordDialog.wdDialogFileOpen?
I want to be able to change the file path from the default "My documuent"
path to something like "e:\test\doc\", see the codes below:
private void WordDialog()
{
object m = Type.Missing;
Word.Dialog dlg =
thisApplication.Dialogs
[Word.WdWordDialog.wdDialogFileOpen];
Type dlgType = typeof(Word.Dialog);
string path = selectedServerPath;
// Set name property of dialog box.
dlgType.InvokeMember("Name",
System.Reflection.BindingFlags.SetProperty |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance,
null, dlg, new object[] {"e:\\test\\doc\\*.doc"});
// Display dialog box.
dlg.Show(ref m);
Close();
}
The code still gives me the "My documuent" path, when this method is
called. How can I fix it? Thanks.
--
Message posted via http://www.officekb.com Tag: DB connectivity in word Tag: 66292
AttachedTemplate
In Word VBA help is an example how to change the AttachedTemplate of a
document:
ActiveDocument.AttachedTemplate = "C:\Templates\Letter.dot"
But when I use this example with my template,
there is always error 5947: document template cannot be changed.
I want to change the template of a lot of Normal based documents,
so how can I do this without getting this error? Tag: DB connectivity in word Tag: 66288
What's the use rand() function in Microsoft Word?
Dear Developers,
.At present I am using Microsoft Office XP version .There is something
amazing happens with me.......that if I typed =rand(200,99) in Microsoft Word
and after Pressing an Enter key.....It displays "The quick brown fox jumps
over the lazy dog" and fills 235 pages of the document with the above
line..........I couldn't understand Why it happens?.....Can u help me in this
matter.
Plz reply me as soon as possible
Waitng for ur positive reply Tag: DB connectivity in word Tag: 66286
How to check the selection is empty after cut?
Hi,
I have the macro that use vba to select the whole text of the current
document consider of a lot of pages and do cut and paste to a new document
as separate pages. But the problem is if my current document is a blank
document, how do i check that it is a blank and the macro will not select
and do cut and paste as i have encountered run time error when the current
document is blank.
please advise. thanks.
regards,
ben Tag: DB connectivity in word Tag: 66280
How to shift up lines in a Word template (.dot) when previous row.
In a Word template created for users to enter row values, if a value is
desired to be left blank, how can I shift up the following rows to fill the
line left blank? Tag: DB connectivity in word Tag: 66276
VB Help
When I try to run a Word macro named UpdateTOC, I receive a "Run time error
'5678': Word cannot find the requested bookmark." message.
When I click the "debug" button, I'm taken to this line within the code:
"Selection.GoTo What:=wdGoToBookmark, Name:="toc""
This is the rest of the code:
```````````````````
Sub UpdateTOC()
Selection.HomeKey Unit:=wdStory
Selection.GoTo What:=wdGoToBookmark, Name:="toc"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
With ActiveDocument
.TablesOfContents.Add Range:=Selection.Range,
RightAlignPageNumbers:= _
True, UseHeadingStyles:=True, UpperHeadingLevel:=1, _
LowerHeadingLevel:=4, IncludePageNumbers:=True, AddedStyles:=""
.TablesOfContents(1).TabLeader = wdTabLeaderDots
End With
Selection.HomeKey Unit:=wdStory
Selection.GoTo What:=wdGoToBookmark, Name:="tocend"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeParagraph
End Sub
`````````````
Can anyone provide any insight in two what is going on or attempting to
happen? I have no experience in VB coding, so laymans terms may be necessary
to explain it. ;-)
Thanks. Tag: DB connectivity in word Tag: 66274
I give up...
I am either too tired to think straight or I am overlooking something
simple here...
Here is the background:
Word 2003.
A document contains some characters that are formatted with the Symbol font
and that were inserted with the Insert Symbol dialog.
The same document also contains "(" that are meaningful.
A macro is looking for those "(" but since AscW(Selection.Text) returns 40
for the "(" and for the Symbol font characters, we need to tell if the
character is really a "(" or not. We do not care what symbol it is, as long
as we can tell the symbol apart from the "(".
So, I came up with this macro using some of the clever code I found from
Klaus Linke:
'_______________________________________
Sub MainMacro()
Dim MyRange As Range
Dim CheckCar As Range
Set MyRange = Selection.Range
For Each CheckCar In MyRange.Characters
If AscW(CheckCar) = 40 Then
If CheckIfSymbol(CheckCar) Then
MsgBox "Ne pas traiter ce caractère."
Else
MsgBox "Traiter cette parenthèse."
End If
End If
Next
End Sub
'_______________________________________
'_______________________________________
Function CheckIfSymbol(MyCar As Range) As Boolean
CheckIfSymbol = False
With Selection.Find
.Text = "[" & ChrW(61472) & "-" & ChrW(61695) & "]"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute
If .Found Then
MsgBox "Ce n'est pas un parenthèse ouvrante"
CheckIfSymbol = True
End If
End With
End Function
'_______________________________________
Basically, I check every character that are selected, if I find that one of
them is a "(", I double check to make sure that it really is a "(" and not a
symbol.
Here is the problem:
With
.Wrap = wdFindStop
in the function, the .Found property is always false, even if a symbol is
currently selected.
If I change
.Wrap = wdFindStop
to
.Wrap = wdFindContinue
Then the .Found property is always true because it always finds the symbol
character in the document, even if it is not in the original selected range.
Why is the Find actually working to tell symbols apart from "(" when doing a
document wide search, but not when checking a specific character?
I have done this before, but not with symbol characters. I remember doing
this to tell if a selected character was a section break or a page break. I
used basically the same kind of code and it worked without any problem. This
isn't working and I cannot tell why! Something to do with wild cards?
Arrrggghhh! I need a coffee!
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org Tag: DB connectivity in word Tag: 66271
Word Replace Function
Hi
I am using Word 2003 and am trying to figure out if there is a way to
restrict the Replace functionality to only search/replace in the document
header/footer.
When the document opens up, the user is presented with a form. One of the
fields they enter into the form will be used for the Search/Replace.
Thanks in advance Tag: DB connectivity in word Tag: 66264
Find, Cut, then Paste Methodology
I have a number of documents that have questions in one part of a document
and the corresponding answers in another part of the document. I need to
modify the document to have the answer four lines after the associated
question.
I need to be able to:
1) loop through the document,
2) find "question 1",
3) go down 4 lines and mark that location as the place to paste "answer 1",
4) then find "answer 1",
5) cut "answer 1" and paste in the new location for "answer 1".
6) loop to the next question number.
Can anyone help me get started?
Thanks in advance,
Raul Tag: DB connectivity in word Tag: 66253
Styles that inherit
Is it possible in Word to define styles that inherit margins from the
paragraph that precedes? IOW, I would like to define, say "Bullet" to
indent 0.2 in from the left of the margin, with "margin" being defined
by the style of the previous paragraph. "Bullet" therefore is always
indented 0.2" in from whatever is above it. TIA Tag: DB connectivity in word Tag: 66252
Adding FormFields
G'day there One & All,
Please accept my apology if I've come to the wrong NG, although
the name seems inclusive of pretty much everything related to Word VP
Programming =).
I'm currently trying to write a bit of a Word application. I'm not
a trained, nor even a practised, macro writer but I have had a little
success with Excel applications for my employer. I'm still trying to
come to grips with Word's way of doing things and I've struck
difficulties.
I have a document with a table at the top of the page. It has only
a single row with 4 cells. The first contains day & date fields which I
have working the way I want. The next 3 cells are causing my problems.
After the headings I'm trying to get FormFields for data entry as
follows:
Name: Shift: Number:
[ ] [ ]-[ ] [ ]
As you can probably guess, the "Shift" fields are for start &
finish times. I'll write a macro to add 8 hours to the start time to
automatically enter the end time. Name & Number need nothing fancy.
I have 2 command buttons included which are labelled "+" & "-".
What I'm trying to do is to have the first one add a row of fields under
what's already there:
Name: Shift: Number:
[ ] [ ]-[ ] [ ]
[ ] [ ]-[ ] [ ]
...and the latter one bring up a form to select a name and remove the
fields associated with it.
I can make & manipulate the userform without any problem, but I
can't figure out how to make the fields appear where I want them
(immediately below the others, in the same cells).
I could probably get it to work by making a nested table of only
one column width for each field - code for which I found on a forum
somewhere - but although that was suitable for the forum member's
situation, that seems to be just a workaround here. Surely there must be
some way to position text entry formfields when you make them.
Can anybody please shed some light on this for me?
Thanks in advance,
Ken McLennan
Qld, Australia Tag: DB connectivity in word Tag: 66249
Reading info from styles
Hi Folks,
I'm trying to find a quick and dirty way of reading the Tab information
(Alignment & leader), Bullet information (whether bulleted, Numbered or
Outline Numbered and all the customizations) and Border settings from a
style.
Any pointers, Especially on the Tab and Numbering, would be grately
appreciated.
Thanks
J Tag: DB connectivity in word Tag: 66248
inserting name and country inside the letter
i have two word document, one include atable which include the name and the
country, and i have a letter which i have to get each name and country from
the table and entering it to the letter then printing it
regards,
--
*******************
Ahmad Baqleh Tag: DB connectivity in word Tag: 66246
Array with error memorisation
Thanks for your answers,
But now I need to create an error memorisation of the previous calulation I
made in my matrix.
And sort those results.
I'm trying to do it with LNo algo, but I can fix one bug.
The first item should be which one? how do I initialise the i var of the
algo?
If you can help me thanks a lot!!
Cheers
Mathew Tag: DB connectivity in word Tag: 66239
Need some help with VBA as it applies to Word AutoFormat
Here is the problem in a nutshell:
I launch Word thru automation.
I then populate tabular data into a document that I obtain from a
database
I format the data using the AutoFormat property off the table object
I save the document as an HTML file.
>From what I can see, the HTML file is saved, but the data looks to be
missing.
So, instead of saving it to an HTML file, I saved it to a DOC file.
Then, I see what the problem is -- the formatting has not been applied
(or completed) prior to saving the document. If I format it, or change
the formatting, I find that the data is correct.
I try this without automation, and what I find is that for a large
table, the data is populated first, and the formatting takes place
(likely) in the background, and takes some time to finish.
What is likely happening is that the save occurs before the formatting
has completed.
Any way to solve this problem, such that I can wait for some event or
some flag to be set before I initiate the save operation?
Are there properties in the Word object or its sub-objects that I can
set to achieve the desired result? Something along the lines of a
non-background formatting?
Any pointers would be a big help.
Thanks in advance. Tag: DB connectivity in word Tag: 66228
How can I load a library in a Macro.
I have to make a macro that calls a library to show several forms when the
user press the macro-button before the document is saved.
I remember I have done so with word 97 using LoadLibrary("file.dll"), but
with word 2k it seams it is not possible.
Does anybody know if it is possible to use this api in word2000.
Regards. Tag: DB connectivity in word Tag: 66220
Style formatting through VBA
This is a multi-part message in MIME format.
------=_NextPart_000_000F_01C53944.14BE1C90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I have been doing customizations for companies (mostly law firms) from =
Word 6 through 2000. When setting up their styles, I use the following =
method:
=20
First, I insert dummy text by typing =3Dand(10,5) to insert 10 =
paragraphs, with 5 sentences each. Then, in each paragraph, I apply the =
required formatting and save the style name. =20
=20
When I am done, I have a bunch of paragraphs with the text: "The quick =
brown fox jumps over .", and it is not clear what style is applied =
without looking at the stylename name drop-down list.
=20
So, I created the following macro which loops through all paragraphs in =
the document. It turns on the Bold attribute, inserts the name of the =
style at the beginning of the paragraph and then turns off the Bold =
attribute. =20
Sub StyleName()
Dim opara As Paragraph
For Each opara In ActiveDocument.Paragraphs
If opara.Style <> "Normal" Then
Selection.Font.Bold =3D wdToggle
opara.Range.InsertBefore Text:=3DFormat(opara.Style.NameLocal & ". =
")
Selection.Font.Bold =3D wdToggle
End If
Next opara
End Sub
=20
This method has worked very good for Word 97 and Word 2000. However, it =
does not work for Word XP or Word 2003. I have split the window and =
watched how it works as I step through the macro (pressing F8). I see =
it turn bold on, then it goes to the beginning of the paragraph (before =
the bold on command which effectively turns bold off), inserts the name =
of the style, then does the Bold toggle, but since it was just turned =
off before it inserted the text, it is now turning Bold on after the =
text has been inserted and the text is not bold. =20
=20
Any suggestions on how I can make this work in Word 2003?
=20
Thanks,
Anne
=20
------=_NextPart_000_000F_01C53944.14BE1C90
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>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2604" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2>Hi,</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial =
size=3D2>I have=20
been doing customizations for companies (mostly law firms) from Word 6 =
through=20
2000. <SPAN style=3D"mso-spacerun: yes"> </SPAN>When setting up =
their styles,=20
I use the following method:</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><?xml:namespace =
prefix =3D o ns =3D=20
"urn:schemas-microsoft-com:office:office" /><o:p><FONT face=3DArial=20
size=3D2> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2>First, I insert dummy text by typing =3Dand(10,5) to insert 10 =
paragraphs,=20
with 5 sentences each. <SPAN style=3D"mso-spacerun: =
yes"> </SPAN>Then, in=20
each paragraph, I apply the required formatting and save the style name. =
<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN></FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial =
size=3D2>When I am=20
done, I have a bunch of paragraphs with the text: <SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>=93The quick brown fox jumps =
over =85=94, and=20
it is not clear what style is applied without looking at the stylename =
name=20
drop-down list.</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT size=3D2>So,=20
I created the following macro which loops through all paragraphs in the=20
document. <SPAN style=3D"mso-spacerun: yes"> </SPAN>It turns on the =
Bold=20
attribute, inserts the name of the style at the beginning of the =
paragraph and=20
then turns off the Bold attribute.<SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN></FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"mso-spacerun: yes"><FONT face=3DArial =
size=3D2></FONT></SPAN> </P><SPAN=20
style=3D"mso-spacerun: yes">
<P><FONT face=3DArial size=3D2>Sub StyleName()</FONT></P>
<P><FONT face=3DArial size=3D2>Dim opara As Paragraph</FONT></P>
<P><FONT face=3DArial size=3D2>For Each opara In=20
ActiveDocument.Paragraphs</FONT></P>
<P><FONT face=3DArial size=3D2> If opara.Style =
<> "Normal"=20
Then</FONT></P>
<P><FONT face=3DArial size=3D2> =20
Selection.Font.Bold =3D wdToggle</FONT></P>
<P><FONT face=3DArial size=3D2> =
opara.Range.InsertBefore=20
Text:=3DFormat(opara.Style.NameLocal & ". ")</FONT></P>
<P><FONT face=3DArial size=3D2> Selection.Font.Bold =
=3D=20
wdToggle</FONT></P>
<P><FONT face=3DArial size=3D2>End If</FONT></P>
<P><FONT face=3DArial size=3D2>Next opara</FONT></P>
<P><FONT face=3DArial size=3D2>End Sub</FONT></P></SPAN>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT =
face=3DArial><FONT=20
size=3D2>This method has worked very good for Word 97 and Word=20
2000. However, it does not work for Word XP or Word =
2003.<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>I have split the window and =
watched how=20
it works as I step through the macro (pressing F8).<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>I see it turn bold on, then it =
goes to=20
the beginning of the paragraph (before the bold on command which =
effectively=20
turns bold off), inserts the name of the style, then does the Bold =
toggle, but=20
since it was just turned off before it inserted the text, it is now =
turning Bold=20
on after the text has been inserted and the text is not bold.<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN></FONT></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial =
size=3D2>Any=20
suggestions on how I can make this work in Word 2003?</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>Thanks,</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2>Anne</FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial=20
size=3D2> </FONT></o:p></P></DIV></BODY></HTML>
------=_NextPart_000_000F_01C53944.14BE1C90-- Tag: DB connectivity in word Tag: 66215
AutoText
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C5393F.83374ED0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have some questions about creating AutoText entries. This is going to =
be long-winded so bear with me, because there is a very specific reason =
for doing this.
=20
I have been using the following code using two input boxes to create =
AutoText entries, and either assign that entry to an existing category =
(such as Mailing Instructions) or create a new category (such as =
Stamps). =20
=20
Public Sub CreateNewAutoText()
Dim strATName As String
Dim strATCategory As String
'Get the AutoText Name
Dim Message, Title
Message =3D "Enter the name for the AutoText Entry" ' Set prompt.
Title =3D "Create AutoText Entry" ' Set title.
strATName =3D InputBox(Message, Title)
=20
'Get the AutoText Category
Dim atMessage, atTitle
Message =3D "Enter the category for the AutoText Entry" ' Set prompt.
Title =3D "Create AutoText Entry" ' Set title.
strATCategory =3D InputBox(atMessage, atTitle)
=20
Selection.CreateAutoTextEntry strATName, strATCategory
End Sub
=20
This has worked very well, using input boxes. I have now set it up with =
a userform (which basically works the same as the above). Following is =
the code for the userform:
=20
Public strATCategory As String
Public strATName As String
Private Sub cmdCancel_Click()
Unload Me
End Sub
=20
Private Sub cmdOK_Click()
Selection.CreateAutoTextEntry strATName, strATCategory
Unload Me
End Sub
=20
Private Sub txtATCategory_Change()
strATCategory =3D txtATCategory.Text
End Sub
=20
Private Sub txtATName_Change()
strATName =3D txtATName.Text
End Sub
=20
Using either of the above methods, an AutoText entry is created in =
Normal.dot. This is fine for most users on the network, however, I =
would like to extend the macro for IT staff so that when they create a =
new AutoText entry that should be firmwide, it can be created in their =
global template (currently SKGlobal.dot) and distributed to users, =
without overwriting the user's Normal.dot. =20
=20
I know that most consultants recommend locking down Normal.dot (making =
it read only), but if you do this, you disable any customization on the =
user's part. They cannot create new AutoText, formatted AutoCorrect, =
Macros, or custom toolbars. This slows productivity on their part. =
What I do for my clients is create a new template that all new documents =
are based on (i.e., SKBlank.dot). The File, New menu option and the =
blank document icon on the standard toolbar (and the Word icons on the =
desktop or Programs menu) are remapped so that all new documents not =
based on another template (such as letter, memo, fax, etc) are based on =
this template rather than on Normal.dot. This way, the users can have =
access to store customizations of their own in Normal.dot.
=20
I would like to extend the above userform for the IT staff at the =
company to create new AutoText entries in their global template (in this =
case, SKGlobal.dot) rather than in Normal.dot. =20
=20
I have done some testing with the above procedures. They both work very =
well for creating AutoText entries in Normal.dot, with the name you =
specify and creating a new category if needed. All new entries created =
are stored in Normal.dot. However, if I then try to copy the new =
entries to the SKGlobal.dot, they are copied in a different way. Each =
entry is copied with the name of the AutoText entry as a category and as =
an AutoText entry under that category with the same name. For example, =
I previously created AutoText entries named Draft and Draft Autodate =
under the category Stamps, which was stored in Normal.dot. If I use the =
Organizer to copy those entries into SKGlobal.dot, then choose Insert, =
AutoText, I will see a category in the drop down list named Draft, which =
has an AutoText entry named Draft and a Category named Draft Autodate, =
which has an AutoText entry named Draft Autodate. =20
=20
Is there anyway when using either of the above methods of creating new =
AutoText entries that I can specify the template that the AutoText =
should be stored in?
=20
Sorry for the long-winded message, but I am desparate here.
Anne
------=_NextPart_000_0006_01C5393F.83374ED0
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>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2604" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have some questions =
about creating=20
AutoText entries. This is going to be long-winded so bear with me, =
because=20
there is a very specific reason for doing this.</SPAN><?xml:namespace =
prefix =3D o=20
ns =3D "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have been using the =
following code=20
using two input boxes to create AutoText entries, and either assign that =
entry=20
to an existing category (such as Mailing Instructions) or create a new =
category=20
(such as Stamps).<SPAN style=3D"mso-spacerun: yes"> =20
</SPAN></SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Public Sub=20
CreateNewAutoText()<BR>Dim strATName As String<BR>Dim strATCategory As=20
String</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">'Get the AutoText =
Name<BR>Dim=20
Message, Title<BR>Message =3D "Enter the name for the AutoText=20
Entry" ' Set prompt.<BR>Title =3D "Create AutoText=20
Entry" ' Set title.<BR>strATName =3D InputBox(Message, =
Title)</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">'Get the AutoText =
Category<BR>Dim=20
atMessage, atTitle<BR>Message =3D "Enter the category for the AutoText=20
Entry" ' Set prompt.<BR>Title =3D "Create AutoText=20
Entry" ' Set title.<BR>strATCategory =3D =
InputBox(atMessage,=20
atTitle)</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"> =20
Selection.CreateAutoTextEntry strATName, strATCategory<BR>End=20
Sub</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">This has worked very well, =
using=20
input boxes. I have now set it up with a userform (which basically =
works=20
the same as the above). Following is the code for the=20
userform:</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Public strATCategory As=20
String<BR>Public strATName As String</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Private Sub=20
cmdCancel_Click()<BR> Unload Me<BR>End=20
Sub</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Private Sub=20
cmdOK_Click()<BR> Selection.CreateAutoTextEntry =
strATName,=20
strATCategory<BR> Unload Me<BR>End =
Sub</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Private Sub=20
txtATCategory_Change()<BR>strATCategory =3D txtATCategory.Text<BR>End=20
Sub</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Private Sub=20
txtATName_Change()<BR>strATName =3D txtATName.Text<BR>End=20
Sub<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Using either of the above =
methods,=20
an AutoText entry is created in Normal.dot. This is fine for most =
users on=20
the network, however, I would like to extend the macro for IT staff so =
that when=20
they create a new AutoText entry that should be firmwide, it can be =
created in=20
their global template (currently SKGlobal.dot) and distributed to users, =
without=20
overwriting the user=92s Normal.dot.<SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN><o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I know that most =
consultants=20
recommend locking down Normal.dot (making it read only), but if you do =
this, you=20
disable any customization on the user's part. They cannot create =
new=20
AutoText, formatted AutoCorrect, Macros, or custom toolbars. This =
slows=20
productivity on their part. What I do for my clients is create a =
new=20
template that all new documents are based on (i.e., SKBlank.dot). =
The=20
File, New menu option and the blank document icon on the standard =
toolbar (and=20
the Word icons on the desktop or Programs menu) are remapped so that all =
new=20
documents not based on another template (such as letter, memo, fax, etc) =
are=20
based on this template rather than on Normal.dot. This way, the =
users can=20
have access to store customizations of their own in=20
Normal.dot.</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I would like to extend the =
above=20
userform for the IT staff at the company to create new AutoText entries =
in their=20
global template (in this case, SKGlobal.dot) rather than in =
Normal.dot. =20
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p> </o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have done some testing =
with the=20
above procedures. They both work very well for creating AutoText =
entries=20
in Normal.dot, with the name you specify and creating a new category if=20
needed. All new entries created are stored in Normal.dot. =
However,=20
if I then try to copy the new entries to the SKGlobal.dot, they are =
copied in a=20
different way. Each entry is copied with the name of the AutoText =
entry as=20
a category and as an AutoText entry under that category with the same=20
name. For example, I previously created AutoText entries named=20
Draft and Draft Autodate under the category Stamps, which was =
stored in=20
Normal.dot. If I use the Organizer to copy those entries into =
SKGlobal.dot, then choose Insert, AutoText, I will see a category in the =
drop=20
down list named Draft, which has an AutoText entry named Draft and a =
Category=20
named Draft Autodate, which has an AutoText entry named Draft =
Autodate. =20
</SPAN><o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt">Is there anyway when =
using either=20
of the above methods of creating new AutoText entries that I can specify =
the=20
template that the AutoText should be stored in?</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p> </o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt">Sorry for the =
long-winded=20
message, but I am desparate here.</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT face=3DArial=20
size=3D2></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in =
0pt">Anne</P></BODY></HTML>
------=_NextPart_000_0006_01C5393F.83374ED0-- Tag: DB connectivity in word Tag: 66212
GetSpellingSuggestions problem
Can anyone please suggest to me why the second call to
GetSpellingSuggestions() below raises an exception when the first one works
fine?
VarCustDict := 'C:\myPath\myDictionary.dic';
VarLang := wdEnglish;
VarDict := fWordApp.Languages.Item(varLang).NameLocal;
lSuggestions :=
fWordDoc.Range.GetSpellingSuggestions(VarCustDict,
EmptyParam,
VarDict,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam);
VarLang := wdFrench; // for example...
VarDict := fWordApp.Languages.Item(varLang).NameLocal;
lSuggestions :=
fWordDoc.Range.GetSpellingSuggestions(VarCustDict,
EmptyParam,
VarDict,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam);
Regards,
AndrewFG Tag: DB connectivity in word Tag: 66208
How can I use a template and avoid the read only message that ap.
Hi, I'm trying to use a receipe book template from microsoft office and as a
proyect of my home economics class. I can't write any receipe to the
rewritable disc becase it appears a message of "read only document " and my
students said that also. I copied the template to every rewritable disc that
I ask for the proyect and I can't copy any information into the template once
it is in the disc. anything can't be saved because of the read only message.
How can I avoid this and prepare the document to be use by the students in
order to create their own receipe books for the class.
Thank You
Luisa Montero Hme Economics class teacher Tag: DB connectivity in word Tag: 66207
Copy SQL table to Access from Word vba
Hi all,
I have a word application that uses a local Access database. This Access
database I need to updated from a SQL server.
I would like to copy a table from the SQL to the access database like this:
- all data in the Access database are lost
- the SQL table are copied to the Access database, not row by row but simply
copied (this I belive should give more speed)
Can anybody point me in the right direction or even better show me some code
that works
Thanks,
Flemming Tag: DB connectivity in word Tag: 66204
change mulptile fields across several doc's
Is there a way to change fields across several different documents? We have
roughly 148 different document templates. Is there a way to set up fields in
these so that we can run a batch or something simmilar to change the headers
and footers on these files to match the project they will be applied to.
Probably a total of 2 -7 fields per document.
Project Name
Project ID
Contract #
and a couple more
Having to go through these all by hand to set up new projects takes to much
time...
thanks Tag: DB connectivity in word Tag: 66203
Vba to read column of text
Hi,
Is there a way using vba that can copy a particular column of the text that
i want and put into the column of the new file.
For example:
Existing colum
Name Age
Lee 23
tan 34
rich 34
Copy the column of the name and paste it into new file of a new column as
below:
Name
lee
tan
rich
please advise.
thanks.
regards,
ben Tag: DB connectivity in word Tag: 66199
Keeping fonts when saving documents from e-mails
I received a document that is "read only" in my e-mail. One of the fonts in
the e-mail is "Gregorian". When I use the "Save as" feature, then reopen the
document, the font changes from "Gregorian" to what the program believes is
"Gregorian". The font is actually Time New Roman. Part of the problem is
that I do not have the Gregorian font isntalled on my computer, and I do not
know how to get it there. Is there a way to keep the same font???? Tag: DB connectivity in word Tag: 66198
VBA, OCX and system folders
If this isn't the right place to ask this, please redirect me to that place.
I have written an OCX component that will scan from a scanner. When I
try to use it within VBA and Microsoft Word it fails.
I have narrowed it down to the fact that it is not being granted access
to certain folders.
So when it tries to access the ds file in the C:\Windows\TWAIN_32 folder
it errors out. Is there a setting that would allow my OCX to be called
from VBA, but still get access to system files?
Another folder that it cannot get access to is the users temporary
folder: C:\Documents and Settings\Administrator\Local Settings\Temp
This puzzles me because that folder is pretty generic.
Thanks,
Clarence Tag: DB connectivity in word Tag: 66196
Loop through all properties
Hi Folks,
I'm looking for a way to loop through all the properties of a Style (and
maybe other objects in word) so that I can strip out everything and read
the settings placed on them.
i.e. For Each oProp in Activedocuemnt.style("Stylename")
astrMyProp(i) = oProp
Next
Cheers
J Tag: DB connectivity in word Tag: 66193
Tool(s) for additional table options
Has anyone seen any existing tools for providing additional options for
tables? For example, there are a number of tools to create what are known
as Bates labels (basically just numbered labels), but they all create a
*new* page each time rather than allowing you to start in the middle. Along
a similar line (or would tha be row?), there is no simple way to print a
sheet of labels starting on a specific row and I am looking for a tool that
would add that functionality.
TIA,
Mike Tag: DB connectivity in word Tag: 66189
reading rich text Data from database into word
Hi,
is there a way to write rich text from a database field to word directly
without having to use intermediate richtext box ocx to first save the text
(from DB) to this ocx and then copy from there to word like what Iam doing
here as follows ?
Do While Not rs.EOF
txtReference.TextRTF = IIf(IsNull(rs("ReferenceText")), "",
rs("ReferenceText"))
Clipboard.Clear
Clipboard.SetText txtReference.TextRTF, vbCFRTF
Word.Selection.PasteAndFormat wdFormatOriginalFormatting
rs.MoveNext
Loop
--
pdev Tag: DB connectivity in word Tag: 66188
when selecting a icon in word it is not clear if it is enabled or
The toolbar icons when need to be selected are highlighted. However when you
click a few times on it it does not chnage colour to show it is enbaled ie
enabled. therfore the user must move the mouse cursor away to see if it is
enabled or not! Therfore can a red/ green clour surround the icon when you go
over it! Tag: DB connectivity in word Tag: 66178
How to change the Hyperlinkbase in Word with dsofile.dll
Hi,
is it possible to change the hyperlinkbase with VBA and the
"dsofile.dll"?
(I can change all document-properties with dsofile, but I don't know
how to reach the hyperlinkbase)
Or is there another way to change the hyperlinkbase offline?
Greetings,
Karsten Tag: DB connectivity in word Tag: 66177
Activex error when using FileSystemObject
I've hit this problem recently in a subroutine, with code that has been
running fine for several years. I can't see what's changed in my system to
cause the problem. Very occasionally, the code works without error, but I
have not been able to find out why. Obviously, I have setup a reference to
"Microsoft Scripting Runtime".
Here's the exact error:
Run-time error '429':
ActiveX component can't create object
Dim fso As New Scripting.FileSystemObject
Set fso = New FileSystemObject '<< crashes here
I'm using Word 2002.
--
Stephenc Tag: DB connectivity in word Tag: 66176
Executing shell commands in VBA
Hi,
Does anybody know how to execute shell commands such as "copy" in VBA.
Thanks,
Abhishek. Tag: DB connectivity in word Tag: 66170
copy between documents
Hello Group,
I have a document of 1000 single entries.
Some of them are bold.
I wish to copy the non bold entries to a seperate document (VBA)
Thanks,
Michael Singmin Tag: DB connectivity in word Tag: 66161
Electronic Forms
Is it possible to program field properties in an MS Word Electronic Form so
that when information is typed in, the data is automatically transferred to
specific cells within an Excel spreadsheet? Does anyone have any good links
where (if its possible) I could learn how to do this?
Any information anyone can share would be GREATLY appreciated. :o)
Thanks!
Missy K. Tag: DB connectivity in word Tag: 66159
"Swapnil" <Swapnil@discussions.microsoft.com> wrote in message
news:EC7A7D39-EF37-47C8-86E4-84F44975A80E@microsoft.com...
> How can I make database connectivity (Access and Excel) in Microsoft Word
> VBE. If possible please give me one sample code.