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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes Tag: 66212
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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes 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: Html Codes Tag: 66176
Executing shell commands in VBA
Hi,
Does anybody know how to execute shell commands such as "copy" in VBA.
Thanks,
Abhishek. Tag: Html Codes 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: Html Codes 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: Html Codes Tag: 66159
Normal.dot says it's saving changes, but the changes are not saved
I have made a font and margin change in page setup, selected default, said
yes to do you want to save the changes to normal.dot, but when I open a new
document, the old font and margin settings are in effect.
What do I need to do to make my normal.dot retain the change?
Thanks for any assistance! Tag: Html Codes Tag: 66157
All Word files converted to .doc files
I have somehow changed my settings accidently. All of my Word files have
converted to .doc files. How can I change them back to normal Word files w/o
the .doc on the end ?
Respond to Pharma_Research10(removethis)@hotmail.com
Thank you for any help.
--
Alan Tag: Html Codes Tag: 66156
activedocument.close
Hi,
I need to close a .dot document via VBA, but i dont want to save
any changes, nor want the user to be ask if he/she wants to save the
document.
activedocument.close nosave, dontask
Regards,
Bre-x Tag: Html Codes Tag: 66154
Select current paragraph
Hi All!
I want to write a macro to select the current paragraph and transpose it
with the paragraph before.
My problem is finding the command to select the current paragraph - the same
action that occurs on a triple click.
I began with this:
Selection.MoveUp Unit:=wdParagraph, Count:=1
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
but the above is not correct, since if the cursor happens to be at the
beginning of the current paragraph it ends up selecting the paragraph above.
Any advice would be most appreciated!
Rob
:)
--
http://phd.netcomp.monash.edu.au/RobertMarkBram/default.asp Tag: Html Codes Tag: 66150
Finding a style within a selected page
I have a document split into "chapters". Each of these chapters is
headed by a specific style - and in no other place within the
"chapter". Let's call it Heading 1 for clarity.
Is there a way, please, of saying in VBA: "Is my selection point
within a page containing Heading 1"?
Roderick Tag: Html Codes Tag: 66147
FAQ = Frequently Asked Questions - brief - vba - unofficial
FAQ = Frequently Asked Questions - brief - vba - unofficial
This FAQ is posted weekly.- more or less
Please save us all some time by reading it before posting to the
news group.
This newsgroup is about VBA - Visual Basic for Applications -
which is the programming language for Word 97-2003 (macros).
There is a longer FAQ with more questions and links that is
regularly posted in the non-VBA Word newsgroups. You may want
to check that out as well.
--- BEFORE POSTING ANYTHING PLEASE READ THESE ---
http://www.mvps.org/word/FindHelp/Posting.htm
http://www.dts-l.org/goodpost.htm
Reading these articles will help you get a quick and meaningful
response to your question rather than just more questions for you.
It may keep your message from being screened or bounced.
A few basics, though:
(1) Be nice; everyone answering questions here is a volunteer.
(2) Post a question in only one newsgroup generally. If you
_have to_ post in more than one, post a _single_ message and
put both newsgroups in the header for that _single_ message.
(3) Do not attach anything to a message.
(4) The only really stupid question is the one you don't ask.
(5) Do not use your real email address unless you want spam.
(See bottom for sample.)
The reasons for the requests are spelled out on the web page.
A longer version of this FAQ is also on the Internet at
http://addbalance.com/word/index.htm
Newsgroup Archives:
http://groups.google.com/advanced_group_search
MVPs FAQ site: http://www.mvps.org/word/ To the extent
there is any "official" FAQ, this is it.
---
Also, before posting, you may want to look at the following
questions to see if yours is among them.
---------- ---------- ---------- ---------- ---------- ----------
1. I see a macro in a newsgroup I would like to try. How
do I add it to my template?
http://addbalance.com/word/macrosfromnewsgroup.htm or
http://www.mvps.org/word/FAQs/MacrosVBA/CreateAMacro.htm
2. What are some good books for me to read about Word?
http://addbalance.com/word/wordbooks.htm and
http://www.mvps.org/word/Tutorials/BookRecommendations.htm
3. How can I run a macro automatically when a document opens,
closes, is created?
http://www.mvps.org/word/FAQs/MacrosVBA/DocumentEvents.htm
4. How can I distribute or backup macros / customizations?
http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm
http://addbalance.com/word/movetotemplate.htm
5. What is an MVP?
http://www.mvps.org/word/AboutMVPs/index.html and
http://addbalance.com/word/mvp.htm
6. I need to make a form to...
Userforms are custom dialog boxes written using vba.
If you want a fill-in-the-blanks form you want what Word
calls an online form. Look in Word's help for that,
and for more info on online forms follow the links at:
http://addbalance.com/word/wordwebresources.htm#Forms
especially Dian Chapman's series of articles
If you want a custom dialog box that you code with VBA commands
you want a UserForm. Take a look at:
http://www.mvps.org/word/FAQs/Userforms.htm
7. Where can I find more information on the Web?
http://addbalance.com/word/wordwebresources.htm#webvba
http://www.mvps.org/word/FAQs/MacrosVBA.htm
http://www.mvps.org/word/FAQs/Userforms.htm
http://www.mvps.org/word/FAQs/Customization.htm
http://www.mvps.org/word/FAQs/OfficeInterdev.htm
Comments / corrections / additions may be sent to
wordfaq@no.spam.addbalance.com. Remove no.spam from the
address. (This is a "proofed" email address, I hope.)
Posted 2 April 2005
Charles Kenyon (the editor) Tag: Html Codes Tag: 66143
Global Templates
I use Office 2003 and am new at MS Word macros. As I was starting to create
a few macros that I would want to use for some time, I was advised to put
them into a special global template for safe keeping in case I had to start
over with a clean normal.dot. Although this still sounds like good advice,
it along with a few other things have me a little confused. If someone can
answer the following few questions, I think it will clear up my confusion.
When I click Alt F8 (Macros) and click the dropdown arrow for "Macros in", I
see 3 options, namely Normal.dot, Bob1-Global.dot (Global template), and
Bob1-Global.dot (Template). The first one (Normal.dot) has 3 macros in it.
The other 2 templates have not only almost the same name, but also the same
3 macros in them. The difference is that if I am viewing them in the Global
Template, they are NOT editable.
Here are the questions.
1. Why do there appear to be 2 templates called Bob1-Global.dot (one
referred to as a global template and the other simply as a template)?
2. Is the advice I received earlier (to put my macros into a specialized
global template (rather than the normal.dot (for safe keeping) good advice?
3. How can I move macros from one template to another?
Thank you for your help.
Bob Tag: Html Codes Tag: 66140
Error message
I start a new document in Word and I keep getting this;
C:\Program Files\Microsoft Office\Office10\WINWORD.EXE and when I click OK,
Word ends the program and dose not save what I have written. I reinstalled
the Word Program with original defaults and now I cannot access Word because
I have to have the Product Code. Without the Code, I'm dead in the water.
How do I fix this problem? Tag: Html Codes Tag: 66130
Befuddled by Bookmarks
I am really becoming confused when it comes to navigating bookmarks. I have
no problem when I reference bookmarks by name, but I run into problems
whenever I try to vavigate based on wdGotoNext, wdGotoAbsolute, wdGotoFirst,
etc. I have a document with 3 bookmarks (the msgbox confirms this when I run
the macro below). However, the code below always returns "The bookmark does
not exist". when it hits the .Goto. What am I missing?
Public Sub macro2()
Dim rng As Range
MsgBox ActiveDocument.Range.Bookmarks.Count
Set rng = ActiveDocument.Range.GoTo(wdGoToBookmark, wdGoToAbsolute, 2)
End Sub Tag: Html Codes Tag: 66128
Out of Memory Problem in Word Automation
Hello
I use Visual C++ to automate the creation of a Word document.
All is working fine, I insert header, footer, Toc, ....
In the last application I'm developping, I need to insert a lot of jpeg
file. From 10 to 200 (and some times more), each beeing 100 to 200 Kb size.
I tried by adding picture that are saved to the word doc and then by simply
linking to an external file....
In both case (but later when doing external link), I got a small window 'Out
of Memory' ...
What shoudl I do to avoid this ? I guess having a 30 Mb file is not that
much with today's computers .... I got 512 MB on memory board and plenty of
space on the hard disk.....
I use UndoClear command too...
Thansk for any clue solving this
Thierry
Here is the typical code I'm using :
#define vtTrue COleVariant(( short) TRUE)
#define vtFalse COleVariant(( short) FALSE)
#define vtOptional COleVariant(( long) DISP_E_PARAMNOTFOUND, VT_ERROR)
#define IntToVt( nInt) ( COleVariant(( short) nInt, VT_I2))
// Get In-Line Shapes
InlineShapes WordInlineShapes = WordSelection.GetInlineShapes();
InlineShape WordInlineShape = ( InlineShape) NULL;
WordSelection.InsertParagraph();
Range WordPicRange = WordSelection.GetRange();
// Set Source Range
// Note: AddPicture requires aVARIANT as the Range Parameter
LPDISPATCH lpPicDisp = WordPicRange;
VARIANT vtDisp;
vtDisp.vt = VT_DISPATCH;
vtDisp.pdispVal = lpPicDisp; // Assign IDispatch pointer of Range to
Variant
// Add Picture
if ( bLinkedToFile)
WordInlineShape = WordInlineShapes.AddPicture( strPicPath,
vtTrue, //LinkToFile
vtFalse,
//SaveWithDocument
&vtDisp);
else
WordInlineShape = WordInlineShapes.AddPicture( strPicPath,
vtFalse, //LinkToFile
vtTrue,
//SaveWithDocument
&vtDisp);
WordSelection.MoveDown( vtUnitLine, IntToVt(15), vtFalse);
// Clean Up
WordPicRange.DetachDispatch();
if ( WordInlineShape != ( InlineShape) NULL)
WordInlineShape.ReleaseDispatch();
WordInlineShapes.ReleaseDispatch(); Tag: Html Codes Tag: 66119
Preview image for wizards & templates
I created a Wizard and a Template. How do I set the preview
image that shows up when you try to create a new document
based on the wizard and/or template? Tag: Html Codes Tag: 66112
Spelling Error Fequency
For those who frequent these NGs regularly you know that I can't spell.
Actually I can spell, but I am careless.
I have been monkeying around with some code that will search a document then
list alphabetically all misspelled words. I am using my budding but limited
knowledge of arrays to sort the list and purge out duplicates so words that
are misspelled more than once are only listed once. It works.
I was thinking it would be helpful to determine and list how many times each
word was misspelled. I think it would be possible, but I am not sure how I
would proceed.
Currently I am comparing each error to the contents of the existing array
and if a match occurs I am skipping that error. This way identical
misspellings the array only contains one instance of the misspelling. I
don't see how I could work a counter into this process.
Maybe if all words where put into the array initially, sorted in then
compare the first to the second and if a match occurs delete the first and
compare the second to the third until a match doesn't occur then jump up one
error and proceed on. This sounds achievable, but I don't know how to do
it.
Any thoughts?
Here is the current code:
Sub printSpellingErrors()
Dim arrSpArray() As String
Dim oSpErrors As ProofreadingErrors
Dim oSpError As Object
Dim i As Integer
Dim oRng As Range
Set oSpErrors = ActiveDocument.Range.SpellingErrors
If oSpErrors.Count = 0 Then
MsgBox "The document contains no spelling errors."
End
End If
ReDim arrSpArray(0)
'Add each error to the array if not a duplicate
For Each oSpError In oSpErrors
'Compare to each exist element in the array
For i = LBound(arrSpArray) To UBound(arrSpArray)
If oSpError = arrSpArray(i) Then
'Skip if already in array
GoTo SkipToNext
End If
Next i
'Otherwise add to array
arrSpArray(UBound(arrSpArray)) = oSpError
'Preserve and resize array for next element
ReDim Preserve arrSpArray(UBound(arrSpArray) + 1)
SkipToNext:
Next oSpError
'Remove last empty element
If UBound(arrSpArray) > 0 Then ReDim Preserve
arrSpArray(UBound(arrSpArray) - 1)
'Pass array to sort
BubbleSort arrSpArray
'Prepare for display
Set oRng = ActiveDocument.Range
oRng.Move
'oRng.Text = vbCr
oRng.InsertBreak wdSectionBreakNextPage
oRng.Move
oRng.Text = "List of Misspelled Words" & vbCr
oRng.Move
i = 0
For i = LBound(arrSpArray) To UBound(arrSpArray)
oRng.Text = arrSpArray(i) & vbCr
oRng.Collapse Direction:=wdCollapseEnd
Next i
'Clip empty paragraph
oRng.Characters.First.Previous.Delete
End Sub
Sub BubbleSort(TempArray As Variant)
Dim Temp As Variant
Dim i As Integer
Dim bolExchange As Integer
Do
bolExchange = False
'Loop through each element in the array.
For i = LBound(TempArray) To UBound(TempArray) - 1
'If element > next element then exchange the two elements.
If LCase(TempArray(i)) > LCase(TempArray(i + 1)) Then
bolExchange = True
Temp = TempArray(i)
TempArray(i) = TempArray(i + 1)
TempArray(i + 1) = Temp
End If
Next i
Loop While bolExchange
End Sub
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: Html Codes Tag: 66107
Declaring
I am trying to discipline myself to properly declare variable. In the
example below it took me 15 minutes to stumble on Oject to work with
oSpError. Is Object the right choice in this case?
Sub printSpellingErrors()
Dim oSpErrors As ProofreadingErrors
Dim oSpError As Object
Set oSpErrors = ActiveDocument.Range.SpellingErrors
For Each oSpError In oSpErrors
.......
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: Html Codes Tag: 66104
Tabbing out of Blank Cell
I'm working in Excel 2002
I have a table with 18 columns where the user enters numeric values. The
sheet is proctected, the cells the user inputs information into are unlocked.
Currently I have the following coding:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 18 Then
Cells(Target.Row, 1).Select
End If
End Sub
What this does is if the user tabs out of column 18, row 3 for example, the
cursor goes to column A in the same row.
The above coding works only if there is a numeric value in the cell in
column 18. How can I get the above coding to work if the user leaves the
cell blank?
Thanks.
--
Jamie Tag: Html Codes Tag: 66102
FTP from Word VBA
I want to use VBA to access an FTP site to see if the contents have changed.
If a new subdirectory exists, I want to download the contents of the new
folder. I have reviewed some of the MSDN site's documentation and found
some sample scripts via Google, but I can't even seem to get the initial
Inet object set. I have added a reference to Microsoft Internet Controls.
Could someone please post a simple script example that will open an FTP
connection to a site?
-Brian Tag: Html Codes Tag: 66101
Textbox in Header problem
I have a letterhead template that has a text box inserted and locked in
position outside of the bounding area of the header area that holds the
company logo. When I copy the original documents primary header and paste it
into the new letterhead document, the textbox logo is gone. This is how I'm
trying it.
Original document is active -
activedocument.StoryRanges(wdPrimaryHeaderStory).Copy
I make the new document active -
activedocument.StoryRanges(wdPrimaryHeaderStory).Paste
The text contained in the original document shows up in the new document's
header but the textbox logo is gone.
Any thoughts?
Thanks,
Brent Tag: Html Codes Tag: 66100
wdGotoBookMark Constant
In Word 2002 I am receiving a "bad parameter" error whenever I try to use
wdGotoBookMark (for example, rng.GotoNext wdBookMark). The debugger shows
that the value of the constant is -1. What is the correct value of the
constant? I Googled for an answer (I really doubt I am the first to
encounter this) but could not come up with an answer).
Thanks in advance. Tag: Html Codes Tag: 66098
Multiple ComboBoxes from Excel Named Range
How do I take the following code and build a repeating loop to build an
identical list in 13 different ComboBoxes (i.e. ComboBox1 thru ComboBox13)?
Private Sub Document_Open()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim NoOfRecords As Long
' Open the database
Set db = OpenDatabase("C:\Filename.xls", False, False, "Excel 8.0")
' Retrieve the recordset
Set rs = db.OpenRecordset("SELECT * FROM `SftwrProd`")
' Determine the number of retrieved records
With rs
.MoveLast
NoOfRecords = .RecordCount
.MoveFirst
End With
' Set the number of Columns = number of Fields in recordset
ComboBox1.ColumnCount = rs.Fields.Count
' Load the ComboBox with the retrieved records
ComboBox1.Column = rs.GetRows(NoOfRecords)
' Cleanup
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Sub
Thanks.... DGjr. Tag: Html Codes Tag: 66097
Combo Box with Available Printers
Is there a way to display in a drop-down list at the top of a form all of the
printers the user has access to?
The user's active printer would be shown but they could click on the
drop-down list and select another printer. These would
be network printers that the user has the option of sending their file to --
same as you would see if you clicked on Fie / Print -- I want to display that
drop-down list of printers without displaying the word dialog box for File/
Print. Tag: Html Codes Tag: 66096
Word Index
I have a range object (which is actually a field). I find
a certain word within that range and want to know what
the index of that word is, preferably within the range
although probably within the active document would be
OK. ie is it the 4th word, 10th word.
Any help much appreciated.
Ian Bayly Tag: Html Codes Tag: 66095
Placing graphics
Is there a way I can place an image in Word using VBA or VB using an XY
coordinant system?
If not, I have a document that I automate out of a VB program that places
text and graphics on a page by bookmark. The images are inline and need to
anchor to the bookmark. If I do not show the document my graphics are put
all over the page. If I show the form during the processing the graphics
get placed but the users are confused as they see this word document
flashing and rearranging itself during this process. I am using tables for
this layout. The best way for me to do this is to place the text at the
bookmarks, then place the graphics on the page at an XY position without
showing the form at all. Any suggestions, VB6 word 9.0 object library.
John Tag: Html Codes Tag: 66094
"Break" document
Hi:
I have an *.rtf document conataining reports for restaurants; most of the
time is one store per page, (sometimes more than one page); the store number
is part of the 'header'.
What would be the code, if there is any, to search by store, make a page
break when the report for one store ends and save it as an individaul report,
like 123.rtf, 457, rtf; so at the end of the day I have 10 separate reports.
Thanks,
Dan Tag: Html Codes Tag: 66092
Problems with RTF link font
Hello.
I have created a form that has many different text
fields. At the end of the page is the final section for
comments to be made.
My problem is - there is a tabled section at the beginning
of the document that needs to be repeated if the comments
move into a second page. I am trying to enter it as a
header so that the second page doesn't appear unless it's
necessary.
Now..the problem - I have all the necessary text fields
linked into the header - but if it is more than one word
(rather - if a "space" is used upon the user's entry) then
the linked RTF changes font. The default font of the RTF
is Times New Roman - and it's supposed to be Arial.
I am trying to avoid using VBA...
And all the other paste links won't work as well as the
RTF link.
Suggestions and help please!
TIA,
Sarr Tag: Html Codes Tag: 66090
Add a word to (custom) dictionary
The Word Dictionary object comes in two flavours: 1) "read only"
dictionaries (based on .lex files) and 2) "non read only" dictionaries
(based on .dic files).
Indeed in Word automation you can check if a dictionary is "read only" by
means of the respective ReadOnly property.
But -- here is the mystery -- even if Dictionary.ReadOnly = false, it seems
that there is absolutely nothing that you can actually do to write a new
word into the dictionary! (or delete an existing word from it)i.e. there are
no AddWord or DeleteWord methods...
Questions:
1. Am I right or am I wrong?
2. Is there a work around for adding words to a "non read only" dictionary?
3. If not, then why on earth does Microsoft bother to publish a totally
useless ReadOnly property??
Regards,
AndrewFG Tag: Html Codes Tag: 66080
Acrobat 7 blocks Global Template Save
Users have reported that after installing Acrobat 7 that changes made
to normal.dot are not being saved. One of the posters confirmed that
Shift+File>SaveAll before closing Word resolved his problem. I am
wonder if the following AutoExit would work? I don't have Acrobate 7
(open to donations) so I can't test it here.
Sub AutoExit()
'Place this macro in Normal and other document templates
Dim myTemplate As Template
Dim myString As String
Dim oChgAlert As Balloon
Set myTemplate =3D ActiveDocument.AttachedTemplat=ADe
myString =3D myTemplate.Name
If myTemplate.Saved =3D False Then
Set oChgAlert =3D Assistant.NewBalloon
With oChgAlert
.Heading =3D "Microsoft Word Alert!!"
.Text =3D "Changes have been made that effect the" _
& " Global template, " & myString & ". Do you want" _
& " to save these changes?"
.Button =3D msoButtonSetYesNo
.Animation =3D msoAnimationGetAttentionMinor
If .Show =3D msoBalloonButtonYes Then
myTemplate.Save=20
End If=20
End With=20
End If=20
End Sub Tag: Html Codes Tag: 66074