How can I create a library for Word VBA?
Hi All,
How can I create a library for Word(97 or later version) VBA?
Is there any web site talk about this?
Thanks
Regards Tag: Setting VBA Project Password Tag: 67456
Word Clipboard Full
My Clipboard is full - 24 items. I cannot clip any more and I cannot delete
any of these. I am an experienced user so don't want the usual suggestions. I
do know my way around Word.
Thanks a lot
Charles Tag: Setting VBA Project Password Tag: 67446
Nested Tables
Helmut/JGM
The other day the three of us where looking at the problem of drilling down
to "deep" nested tables. Cindy Meister "shoved" me twice in the right
direction and I think I have finally put together some code that will delete
"ALL" empty paragraphs in a document. Cindy, if you are reading, thanks
again!! The code is probably inefficient and ugly, but I haven't been able
to break it in over a half hour of trying. The code as part of the complete
Add in is available here in you care to have a look.
http://gregmaxey.mvps.org/Clean_Up_Text.htm
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: Setting VBA Project Password Tag: 67441
Disable form field using VBA
Using Word 2002, is there a method to uncheck 'fill-in enabled' using VBA?
For example, on exit of each checkbox in a group, determines if one is
selected and then disables several other fields (so that tab moves to the
next group).
TIA,
Mike Tag: Setting VBA Project Password Tag: 67436
Msbbox - VBok for empty text boxes
Hello,
Created a template with a user form to collect information. Form text and
combo boxes drop information into bookmarks. Everything here works fine.
I have had no success in completing code to get a general message box to
display if any of the text or combo boxes have been left blank when the user
clicks the submit button.
I would like the user to receive the msg. and click OK to return to the from
I am placing my attempt in the cmdSubmit_Click()
Still new to VBA...
--
Thank-you and all suggestions are appreciated. Tag: Setting VBA Project Password Tag: 67429
Error 5102
I am opening a new document based on a template from Access. When I move to
the 2nd bookmark, it gives me "Error 5102: You entered multiple destinations
for a page, line, footnote, endnote, or comment." The bookmark is on the
template and I checked spelling, etc. but have no idea what is causing. Can
anyone shed some light on this? Thanks.
David Tag: Setting VBA Project Password Tag: 67427
Get a cell value from excel
Hi,
Firs of all, thank you for reeding my question. I would like to get a cell
value from a excel file into a word file, using macros programming. I mean,
developing a macro able to read a cell.
Thanks Tag: Setting VBA Project Password Tag: 67423
DATES
I have a form in Word which needs to be 2-sided when printed and contain
calendar dates - one for each day - to be filled in by hand by people without
computer access. Preferable format "Friday, April 29, 2005. Can be moved to
Excel. Any help is greatly appreciated. Tag: Setting VBA Project Password Tag: 67418
Copy text to XML element
I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help Tag: Setting VBA Project Password Tag: 67417
html
Hello,
I have a word document with a lot of html links. How can I download
automatically all the html files of those links?
Bye.
Marcel Tag: Setting VBA Project Password Tag: 67416
hyperlink; read-only
I am trying to find out if it is possible to change the settings of a
hyperlink so that a document will be opened as "Read-only". Thanks! Tag: Setting VBA Project Password Tag: 67414
Opening webpage from vba without opening new IE window
I can open a webpage from vba a couple of different ways:
pAddress = "C:\Program Files\Internet Explorer\IEXPLORE.EXE " & sAddress
Shell pAddress, vbNormalFocus
Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE _
www.washingtonpost.com"), vbNormalFocus
But these open a new IE window each time. Is it possible to load a
webpage into an existing IE window, without open a new IE window?
Thanks,
Larry Tag: Setting VBA Project Password Tag: 67411
VBA question, can't get this macro to work
i can't get the replacement text area to work. It finds the right
information, but i can't get the insert section break to work. PLEASE
HELP!!!!
With Selection.Find
.Text = " APR 1-2005 "
.Replacement.Text = Selection.InsertBreak wdSectionBreakNextPage & "
APR 1-2005 "
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With Tag: Setting VBA Project Password Tag: 67410
Storing Child word documents inside Master documents using Word's document objects.
Hi All,
I am trying to store a word(Child) document inside another word document
(Master) in such a way that the Child document can't be seen when the Master
is opened (Master and Child will be inside a single file). By default, when
the document is opened, the Master document is shown. The Child will be
shown when I click my Active X's "show child document" menu item. To achieve
this I tried to store the Child document inside my ActiveX but quickly found
that I can't store more than approx 200KB (I may be wrong in the exact size)
of Child document. I then tried to store the Child document inside Document
variable of Master Doc. The Document variable is hidden so seemed OK. I
broke my Child document in chunks of 100 KB and stored in recognizable
Document variables of Master document Object. So far so good. I tried this
on Windows 2000 Server with Office 2003 and it worked but on Windows XP
after creating 2 such Document variables containing the Child documents it
started giving strange data e.g. If the Child document size is 60 KB whle
storing, on retrieving I get 100 KB!! which then crashes by application
while checking. This is only happening in Windows XP Home Edition and
Professional.
Now questions;
1) Is there any other way to store word document inside a word document
programmatically ?
2) Any reason why is it failing to give me the correct data?
3) On programmaticall removal of the document variables, the size of the
Master document remains the same, why ?
Thanks for reading..
Regards,
Wahaj Tag: Setting VBA Project Password Tag: 67409
AutoExec macro in Word project won't run when Outlook is running
I have an AutoExec macro in a '.dot' project saved in the StartUp folder. It
is supposed to run everytime I run Word. It does, except that if I have
previously started Outlook (with Word selected as Outlooks e-mail editor),
the AutoExec will not automatically run. Why? How can I get the AutoExec
macro to run regardless of Outlooks presence.
Thanks.
Ed Tag: Setting VBA Project Password Tag: 67405
"Getting rid" of tem,plate information
I have a document, based on a certain template. This template is placed on a
server.
When I mail documents based on this template to customers, and they try to
open the document, Word starts searching for the template in the customers.
It takes a long time, and only when Word "are sure" the template is not
there, it opens the document. This is annoying to my customers.
Is there anyway I can remove the connection between document and template,
before mailing the document, maybe using Document_Close() or someting like
that.?
Jan Tag: Setting VBA Project Password Tag: 67403
thezaurus for English Language
How can I get a thezaurus for English Language to use it in Word? I do not
have it, because I use a Polish version of Office Package. Thank you Tag: Setting VBA Project Password Tag: 67402
Deleting text in bookmarks very slow...
Hello,
I've run into a problem in my C# add-in for Word.
One of the operations that the add-in has to do is going over all =
bookmarks in a document and removing the bookmarks and its content if =
certain conditions are true.
Originally, I tried the following:
bookmark.Range.Text =3D "";
Unfortunately, it did not work correctly in all cases (for example, if =
the bookmark spanned table cells).
So I used the following:
Microsoft.Office.Interop.Word.Range range =3D bookmark.Range;
bookmark.Delete();
range.Delete(ref missing, ref missing);
when "missing" was initialized thus:
object missing =3D System.Reflection.Type.Missing;
That works correctly but, according to the profiler, is 4-5 times =
slower!
Since this operation is performed in a tight loop, on a document with a =
lot of bookmarks that need to be deleted, this slowdown is VERY =
noticeable.
The breakdown of the timing between the 3 lines is roughly:
Microsoft.Office.Interop.Word.Range range =3D bookmark.Range; // =
3.6%
bookmark.Delete(); // 13.8%
range.Delete(ref missing, ref missing); // 82.6%
So the culprit is the range.Delete() operation.
I really need to speed this up!
Any help is appreciated.
Thanks,
Alex.
--=20
Address email to user "response" at domain "alexoren" with suffix "com" Tag: Setting VBA Project Password Tag: 67397
How I can change the default font size in normal.dot via VBA
Hi There I need to change the default font from Times New Roman 12 pt to
Times New Roman 11 pt in Normal.dot. I know how do to that manually but I
need to change the font by VBA in a master template and then update all the
users Normal.dots by pushing out the master template. would you please let me
know what I'm doing wrong in below code any help would be appreciated.
Many Thanks,
Leila
Sub AutoExec()
'
'
'
Font
End Sub
--------------------
Sub Font()
With ActiveDocument.AttachedTemplate.Styles("Normal").Font
.Name = "Times New Roman"
.Size = 11
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Scaling = 100
.Kerning = 0
.Animation = wdAnimationNone
End With
'Selection.Style = ActiveDocument.Styles("Normal")
End Sub Tag: Setting VBA Project Password Tag: 67393
hyperlink shortcut file
In Word 2002, I am hyperlinking to the web, our network and to internal
bookmarks. To access our network, I have to set the hyperlink base for the
document to file://c:\ which then messes up the internal links. It was
suggested that I create a shortcut file to link to and the shortcut file than
access the network. Fine but the process has to be seamless to the user. Do
I need VB or VBA to do this? I don't either so this will be a problem. Any
help is greatly appreicated.
Redbird Tag: Setting VBA Project Password Tag: 67392
How do I insert a drop down menu in a document header?
I am creating a template using Word. I need to insert a drop down menu in
the document Header. I can not add a drop down menu to the header. Tag: Setting VBA Project Password Tag: 67387
Square Boxes
I wrote some code in excel that would take cell values and write it to the
appropriate form field in word. I have vbcrlf but when it gets to word i get
two square boxes instead. Does anyone have a work around?
Anthony Tag: Setting VBA Project Password Tag: 67384
number of lines a cell
What method would I use to calculate the number of lines in a cell within a
table programmatically? Tag: Setting VBA Project Password Tag: 67383
Find 2 lines of text, not one
what do i use to find two lines of text. I am searching through a 10,000
page file that is a billing file. the only thing that specifies a change in
bills is two lines. So i haev to find two lines of text, then replace those
two lines with themselves, plus a section break before the two lines. Tag: Setting VBA Project Password Tag: 67382
Document Protection - Editing Restrictions
I set up a fill-form template in Word 2003. When I tried to set editing
restrictions for users to only enter in data fields I set up, the whole
window was "grayed out" so that I couldn't make any selections.
How can I change this to be normal, useable? Tag: Setting VBA Project Password Tag: 67378
Clearing Whitespace after a bookmark
Hello All,
I have a bookmark at the end of template called End. I'd like to be able to
programatically get rid of any extra whitespace or unessary pages after this
bookmark using a macro.
Any suggestions? Any help would be greatly appreciated.
Thanks,
dave Tag: Setting VBA Project Password Tag: 67376
How to increase a text form field size
I am creating a form in Word. The shaded box is small in length. Although
the size is set to unlimited, when the user types something in the box you
cannot see everything the user types.
How can I set the form field properties so if a person wanted to type
something like (like an address), they can see everything they have typed in
the field? Tag: Setting VBA Project Password Tag: 67373
Linking check boxes
I have a form with two lists of checkboxes. Some checkboxes from list A
should automatically choose a particular checkbox from list B. So, for
instance, if any one of checkboxes 1, 3, 5, or 7 is checked, then checkbox 10
should also be checked. Only one of 1, 3, 5, or 7 will be checked at any
one time, all others will be unchecked.
I found the following code in the newsgroups that will work for a making one
checkbox automatically check a second one. (Thanks!) This could work in my
situation, but I would have to use separate macros for each of my checkboxes.
I am wondering if there is a way to put all into one macro.
Sub SetCheckboxes()
ActiveDocument.FormFields("Check2").CheckBox.Value _
= ActiveDocument.FormFields("Check1").CheckBox.Value
End Sub
Thanks for any ideas anyone can give me! Tag: Setting VBA Project Password Tag: 67368
setting ExitMacro (to template)
Okay, get a load of this:
I am trying to check code using an attached template, and after I perfect
the code, make the attached template a workgroup template. I hope that's
proper.
So, I name the template "Forms.dot" and make it an attached template. (When
"Forms.dot" is my "Normal.dot", the code works perfectly.)
Now, as an attached template (with a blank Normal.dot), the code errors out
at the following code:
ActiveDocument.FormFields(4).ExitMacro = "doCopies"
"doCopies" is a sub within the attached template "Forms.dot", which is where
the code errors. I shouldn't have to refer to the module or project if it's
in the same routine, should I? When I halt the code, and manually go to the
document, I can manually "see" the sub "doCopies", so it's available, but
still my code errors.
Anyway, I can't get past this. Can anyone offer some help?
TIA Tag: Setting VBA Project Password Tag: 67363
How do I eliminate auto text when I open word?
I need assistance. When I open a Word document, there is text already
printed along with a font size. Tag: Setting VBA Project Password Tag: 67358
setting XML elements in Word doc to text
Hi,
From VSTO in Visual Studio.NET, I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help. Tag: Setting VBA Project Password Tag: 67357
setting XML elements in Word doc to text
Hi,
From VSTO in Visual Studio.NET, I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help. Tag: Setting VBA Project Password Tag: 67356
setting XML elements in Word doc to text
Hi,
From VSTO in Visual Studio.NET, I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help. Tag: Setting VBA Project Password Tag: 67355
Any way to have Dialog(wdDialogEditReplace) function like interactive Replace Dialog
Folks,
I want to have the Replace dialog displayed with parameters drawn from a
text file in which the lines have the format "Findstring=ReplaceString".
E.g., an entry of "1=2" would populate the find field of the dialog with "1"
and the replace field with "2". The code below more or less works except
that after the user selects "Replace All", the usual prompt indicating that
"X replacements have been made" or "Word has finished searching the
document" does not appear. Thus, it will be a bit disorienting when using
the routine. Am I missing some properties that enable/disable the messages?
Thanks,
Tom
Sub testreadfile()
Dim AStr() As String
Dim SearchStr As String
Dim RplcStr As String
Dim FString As String
Dim DlgFind As Dialog
Dim AString As String
On Error Resume Next
Set DlgFind = Dialogs(wdDialogEditReplace)
FString = "C:\wordmacros\a.txt"
Open FString For Input Access Read As #1
While Not EOF(1)
Line Input #1, AString
If Len(AString) > 0 And Not AString Like "*[=]*" Then
MsgBox AString + " is not a valid entry"
End If
AStr = Split(AString, "=")
SearchStr = Trim(AStr(0))
RplcStr = (AStr(1))
With DlgFind
.Find = SearchStr
.Replace = RplcStr
.Show
End With
Wend
Close #1
End Sub Tag: Setting VBA Project Password Tag: 67354
embed macro on photo to place in Word 2000 document
Can this be done? I have a user that does not want to press F9 to recalculate
a field in an unprotected form. I cannot protect the form either. Thanks! Tag: Setting VBA Project Password Tag: 67350
Code for Insert Section Break, Please Look If you Know VBA
I am trying to insert a section break before a certain piece of text. I
need to be able to print the first page of a bill to one tray, and the rest
to another tray. I have been told taht is accomplished by page/section
breaks in different points. Here is the code that i am having the problem
with:
I haven't been able to get it totally working. Here is the code i am using.
I can't seem to get the section break to work before i replace the data. the
line wiht the astrixes is the line giving me trouble
With Selection.Find
.Text = "
________________________________________________________________________________________________" & "^l" & " APR 1 - 2005 "
******* .Replacement.Text = Selection.InsertBreak & "^&"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAl Tag: Setting VBA Project Password Tag: 67349
Protect section of document
Some advise on how to achieve the following would be appreciated please.
Using Access 2002 and Word 2002 we are using vba code to automate a merge
between access to a word.
On the access fields are bookmarked in the word doc & merge is working fine.
The concern is that a user would open the word document and delete or edit
the bookmarks
What is the best way to protect the document
TIA
Tom Tag: Setting VBA Project Password Tag: 67340
Closing activedocument
Hi,
We have been using a template for a couple of years without trouble in Word
2000. We've recently upgraded to Word 2003 and the code now produces an
error. The template opens a form which has buttons to execute a mail merge
with some Outlook contacts. It saves the document with a temporary name to
merge the data and print it and then closes the temporary document to go on
to the next person. It uses the lines:
ActiveDocument.PrintOut
ActiveDocument.ActiveWindow.Close SaveChanges:=wdDoNotSaveChanges
Now when it encounters the last line it gives the following error:
You cannot close MS Office Word because a dialog box is open. Click OK,
switch to Word, and then close the dialog box.
It seems to not like the dialog box from the original document being open
when I close the temporary document. Out of interest I opened the same
document on a laptop with Office 2000 and it worked fine again.
Any suggestions please?
John Tag: Setting VBA Project Password Tag: 67336
Delete Certain Lines with Macro
I am taking various txt files and editing them so they will work with
different database programs. The data is coma delimitted. At the end of some
files there may or may not be several blank lines. I need code to delete line
if blank. (I can replace blanks with a word if that makes it any easier)
Thanks in advance for your help. Tag: Setting VBA Project Password Tag: 67334
Drop down_drop down list
I have developed a word 2000 form template which is protected. The user
fills in the blanks. There is a header (but not in the header) that I want
to be able to drop in one of several 2-line addresses. Dropdown has one line
limitation, can dropdown list "break" a line to create the address lines?
Autotext field works, but leaves problems with the "unprotected" sections it
resides in...have run out of ideas. Is there a simple way to give the user
the ability to choose one of two addresses? Best regards Tag: Setting VBA Project Password Tag: 67332
word needs a 'table of hyperlinks' display text, address, page#
this would be useful for managing all the hyperlinks in a document and would
work like a table of contents. It would basically report on display text,
adderss, and page number and by default be sorted by address and page number.
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/community/en-us/default.mspx?mid=1366a012-32ef-4ce6-a0d0-321b6bdd914e&dg=microsoft.public.word.vba.general Tag: Setting VBA Project Password Tag: 67331
Word Forms: text field as number
I define a text field into a form as "number" but when filling the form Word
lets me enter letters into the field.
How can I avoid that?.
Carlos. Tag: Setting VBA Project Password Tag: 67325
Table inside textbox
I need to open a word document and read a multi column table and translate
it
into a table. My problem is that the type of document I want to read stores
a table inside a textbox (an ordinary Word textbox, no Active-x). The text
box seems to hide the table - at least I haven't found the way to get
through it.
How can I access the table inside the text box and read the contents of it,
cell by cell?
I use Word 2003 and XP.
Any help or hint in the right direction would be great.
Aaron Tag: Setting VBA Project Password Tag: 67324
Help to Open, Read a txt file?
I'm trying to open a .txt file and read the contents into a string. If I
hard-code the file path and name, I can use Shell to open it. But then I
can't read the contents into a string. So I was trying to use Open And Read
or ReadLine through the FSO. I guess the FSO is opening the file - it never
becomes visible (which is okay), but the code drops to the Read line. But
with either ReadLine or ReadAll, it errors out - "Input past end of file".
Can someone shed some light, please?
Ed
Dim FSO As Object, File As Object, Contents As String
Set FSO = CreateObject("Scripting.FileSystemObject")
Dim strFName As String
Dim strFPath As String
strFPath = ActiveWorkbook.Path & "\"
strFName = strFPath & "About.txt"
Set File = FSO.OpenTextFile(strFName)
Contents = File.ReadLine
MsgBox Contents Tag: Setting VBA Project Password Tag: 67317
Problem: How to judge word wrap has happened in a cell ?
If i find word wrap has happened in a cell, i'll need merge some right
columns to avoid word wrap. So anyone could give me some suggestions ?
Thanks in advance!
--
David W
Coding Life Tag: Setting VBA Project Password Tag: 67315
How can I edit headers/footers in a protected form?
How can I edit a header or footer in an online document protected for forms?
The fill-in the blank form fields are on page 1, but on the next pages the
sections are unprotected to allow paragraphs of information to be inserted.
Ex. - After page 1 the Footer needs to be changed in each section: Exhibit A
Page 1 of 1, then Exhibit B Page 1 or 2, etc. I don't want to unprotect the
document because sometimes the information in one or two of the form fields
needs to be changed and re-protecting the doc. resets the form fields. Is
there a simple macro that would unprotect the headers/footers and allow
editing without resetting the form fields? Thank you. Tag: Setting VBA Project Password Tag: 67311
Radio button in a form into a Word document
I need to include a radio button (no check button) in a form into a word
document. I´ve tried with a radio button from control palette (or tool
palette, I don´t know its name in english version) but it doesn't behave
well in forms.
Any idea?.
Carlos. Tag: Setting VBA Project Password Tag: 67309
ActiveX Ctrl not displayed in printing!!!!!!!
hi!
I have an ActiveX control for Word written in VC++7.1 using ATL. now when i
insert my control into Word document and print it. It just displays image
rendered on it but doesn't diplay the text displayed on the control. my
OnDraw function looks like that.
HRESULT CMyObj::OnDraw(ATL_DRAWINFO & di)
{
RECT& rc = *(RECT*)di.prcBounds;
RECT TextRect = {0,35,rc.right,rc.bottom/2};
m_CompLogoImg->get_Width(&lImgWidth);
m_CompLogoImg->get_Height(&lImgHeight);
HRESULT hres = m_CompLogoImg->Render(di.hdcDraw,rc.right*3/4,
rc.bottom/2, rc.right*1/4, rc.bottom/2, 0, lImgHeight,
lImgWidth, -(lImgHeight), &r);
CComBSTR bstrText = _T("Location");
ExtTextOut(di.hdcDraw,TextRect.left +2 , TextRect.top,ETO_CLIPPED,
&TextRect, OLE2T(bstrText.m_str), bstrText.Length(), NULL); return S_OK;
}
i found an article
http://www.codeguru.com/Cpp/COM-Tech/atl/printing/article.php/c3559/ but
couldn't understand it well. any body there to solve this problem
Thanks in advance.
Ahmad Jalil Qarshi Tag: Setting VBA Project Password Tag: 67307
how to select one table in a document with multiple tables?
hi all,
i'm looking forward to find a possibility to select one table out of a known
number of tables in my document, and then i want to apply a macro to this
table.
e.g. my document consists of 14 tables an i want the macro to be applied to
table no. 12 using the following procedure:
Sub Verdict_Return_Oliver_Small_Template()
'
' Verdict_Return Macro
' Macro created 26/04/2005
'
ActiveWindow.ScrollIntoView Obj:=Selection.Range, Start:=True
For i = 2 To ActiveDocument.Tables(1).Rows.Count
Selection.Tables(1).Cell(i, 6).Select
LowerLimit = Selection.Calculate
Selection.Tables(1).Cell(i, 7).Select
UpperLimit = Selection.Calculate
Selection.Tables(1).Cell(i, 8).Select
Meas = Selection.Calculate
Selection.Tables(1).Cell(i, 9).Select
If LowerLimit <= Meas And Meas <= UpperLimit Then
Selection.Font.Color = wdColorGreen
Selection.TypeText Text:="PASS"
Else: Selection.Font.Color = wdColorRed
Selection.TypeText Text:="FAIL"
End If
Next i
End Sub
i tried to replace the no "1" in "ActiveDocument.Tables(1).Rows.Count" by 13
but it didn't work.
does anyone know another solution or do i only make a small mistake?
thanks so far, this is one of the best newsgroups i ever saw an my small
procedure was already created with help of you all.
BR,
Oliver Tag: Setting VBA Project Password Tag: 67302
Here's what I ended up with.
It was a difficult birth.
"Howard Kaikow" <kaikow@standards.com> wrote in message
news:%23EWn0TaTFHA.3980@TK2MSFTNGP12.phx.gbl...
> Here's what I ended up with.
> It was a difficult birth.
>
> http://www.standards.com/index.html?SetVBAProjectPassword
>
>