Opening a Mailmerge Word Document from Excel using VBA
Any explanation an assitance would be greatly appreciated.
I have an excel [2000] file that I use to generate a mail merge data set for
word.
Using VBA, I create a excel file with one [1] sheet, then open word, and an
existing mail merge document with all the fields. I then relink the merge
document to the new data file and merge.
This all works but takes approx. 1 minute to the file, and another minute to
relink the new data file. If I open the document through word manually, it
only takes about 3-5 seconds to open the word document, similar to relink.
Can someone first explain the time lag, and/or how to fix it?
Thanks
Simon
[Note: Also posted in Mail Merge group] Tag: puppes Tag: 72836
Option Buttons - Word 2003
I have a form with groups of option buttons for selection. Is there a way to
make the value of the option button "true" as the user tabs up or down
through the selections, i.e., the option is selected at the location the user
has tabbed to and moves with the tab action? I am trying to come up with a
way to select the option without using a mouse on the form. Right now I have
accelerator keys assigned but these become problematic with the quantity of
selections on the form. I couldn't seem to locate anything in the properties
window of the form that sounded like it would fit the bill.
Thanks!
--
singeredel (Julie) Tag: puppes Tag: 72833
how to populate a listbox in word vba
Hi,
How do i get a list of names (I have the five names I need) to appear on a
list box on an word vba form. I have created the vba form and listbox1 but I
can't see how to get the names on there?
Thanks in advance
Go Tag: puppes Tag: 72825
Proper coding of AddOLEObject
I am trying to use VBA code to enter a line of text, and then add an MSGraph
Chart on the very next line, anchored to the text. I am using the following
code, but need to know what to use for the Anchor property:
Selection.TypeText Text:="My text goes here"
Selection.TypeParagraph
Dim oWordApp As Word.Application
Dim oWordDoc As Word.Document
Dim oShape As Word.Shape
Set oWordApp = GetObject(, "Word.Application")
Set oWordDoc = ActiveDocument
'Embed a chart on the document.
Set oShape = oWordDoc.Shapes.AddOLEObject( _
Width:=150, Height:=150, _
ClassType:="MSGraph.Chart", DisplayAsIcon:=False, _
Anchor:=<<<WHAT GOES HERE?>>>) Tag: puppes Tag: 72824
Selection.Tables.Add -- moving the selection
I'm using office automation in Word.
I have a selection and have used Selection.Tables.Add to add a table into
word.
How do I move the selection to the end of the table (i.e. next line?)
If I were to do Selection.TypeText("blah") the text is inserted in the first
cell of the table, which is NOT what I want.
I've tried methods like Selection.Move and MoveEnd... but it doesn't seem to
work. Maybe I'm using it wrong? Any help would be greatly appreciated,
Thank you,
Ray Tag: puppes Tag: 72820
Word Remove Nonprintable characters
I have characters that look like little boxes in my text in Word. The text is
being brought in from a mainframe download. I want to get rid of these
characters but I can't seem to figure out how. Tag: puppes Tag: 72819
InlineShapes
I'm writing an application that make some operations with some objects stored
as inlineshapes in a word document, but when I insert an Autoshape in Word
XP, and an activeX object (CalendarControl) as an inline object, then
InlineShapes.Count returns 1 (I guess because of the calendar control), but
when I try to get the item with InlineShapes.Item(1), it throws an exception,
saying that the item is out of range.
I must get the CalendarControl with InlineShapes.Item(2), despite that the
count property returned that there are only 1 element (count returned 1).
When I check Shapes.Count it returns 1 as well. (I guess because of the
autoshape)
I must get the AutoShape with Shapes.Item(1);
So it seems that there are 2 collections (InlineShapes and Shapes) that
share the indexes.
Is this a bug?
How could I now which index is a InlineShape and which one is a Shape? in
order to not to get the exception when I use the .Item(index) member?
Thanks. Tag: puppes Tag: 72815
Class does not support Automation or does not support expected int
Hi,
G'd morning. In Office 2003, I created a Word template which has a word
document, VBA code, and couple of FORMs. And, I'm getting very strange error
when I change the template.
I added a new textbox, an activeX obj, to the word document, but it seemed
that the old document, created without the new textbox, didn't like the new
textbox somehow, I think.
I got the following error:
Run-time error '430':
Class does not support Automation or does not support expected interface.
the code:
ActiveDocument.txtCompanyName.text = "My Company"
txtCompanyName is the name of the textbox created before.
If I delete the newly created obj from the template, all the old documents
work fine with the code.
I don't know if there is any change in Office 2003 on how to reference
ActiveX obj. Or, I should register the objs before I reference to them in VBA
code.
Is anyone has come across this type of problem?
Thank you very much.
Will.
-- Tag: puppes Tag: 72813
Controlling an external application from Word
Hello guys!
I have a Word medical report and a audio file with the info which must be
written. There is a simple application who runs the audio file. What I want
to know is if I can send a play/pause instruction to that application from
Word!
Is there anyway to do this? I believe I could create a "play" and "pause"
macros (and associate them to a key, for instance)...
I thank anyone who could help me!
Best regards,
--
Ricardo Pinto Tag: puppes Tag: 72812
Word Fields
I am using Word 2002 I have a field code (field on the insert drop
down) that on click needs to select the field (1 or more words) and
then if the user starts typing the text needs to change color and
format. I am new to field codes so i need lots of help Tag: puppes Tag: 72810
Templates on Word 2000
I have a problem with the template on my Microsoft Word 2000
Every time that I open a new window to write something, I always see a
phrase from a previous text that I wrote. Can somebody advise, please, on
how to rectify this?
Many thanks in advance.
CR Tag: puppes Tag: 72807
code for formatting
Hi,
I want a code for formatting a document with the following options. Will any
one guide me with a code for accomplishing this task ?
FONT TAHOMA
FONT SIZE 12
MARGINS LEFT : 3.6 CMS (1.417â??)
TOP : 2 CMS (0.787â??)
RIGHT : 1.7 CMS (0.669â??)
BOTTOM : 1.76 CMS (0.693â??)
Paragraph spacing 1.5 JUSTIFIED
Thank you in advance Tag: puppes Tag: 72802
How to setup Select Variable Page Headers
Would someone please advise me on how to setup my document (which undergoes
many changes) so that I can select variable Headers or change the pre-defined
Page 1 Header automatically? I thought of setting file(s) with different
header texts that would be copied/pasted from the pre-defined text
automatically into the body of the 1st pg Header. However I haven't a clue
as to exactly where to start and how to Get the header text needed.
thx,
Ted Tag: puppes Tag: 72801
Speed of macros reduced to a snail pace
Hi
I recently asked a question about two docs that use the same .dot as
reference to execute macros and install a toolbar.
One of the docs works very well while the other one (much longer table) has
become unusable due to the speed of execution
Today, I inserted a second table in the slow doc and the macros executed
right away.
So I have concluded that it is the length of the main table in the
problematic doc that is causing the problem and nothing else.
I have copied below one of the macros the speed of which seems to be
affected by the length of the table.
Can anyone help me to get around this problem as I can't wait one minute
each time for a macro to execute.
I selcet the word with the cursor before running the macro.
Thanks in advance
Dave Neve
Sub FallingLong()
Dim wordrange As Range, lrange As Range, i As Long, j As Long
Set wordrange = Selection.Range
j = 2
For i = 1 To wordrange.Characters.Count
Set lrange = wordrange.Characters(i)
If Selection.Characters.Count <= 5 Then
lrange.Font.Size = 18
lrange.Font.Size = lrange.Font.Size - j
j = j + 2
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorSkyBlue
Else
lrange.Font.Size = 16
lrange.Font.Size = lrange.Font.Size - j
j = j + 1
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorSkyBlue
End If
Next i
Selection.Collapse Direction:=wdCollapseEnd
Selection.ExtendMode = False
Selection.Font.Reset
Call NextWordSelect
End Sub Tag: puppes Tag: 72795
combine downloaded word docs from website?
Hello,
This is a long shot, but I'm thinking you folks would probably have
some pointers for me.
On this website:
http://www.cityofbellevue.org/page.asp?view=7863
There's a set of links to months. If you click on one of the months
(say, August), you get a set of links to Microsoft Word doc files, 3
for each day of the month:
http://www.cityofbellevue.org/page.asp?view=38806
Is there a way to combine all of these docs into one document, then
sort by district? Would this be something I could do with vba?
thanks for any pointers!
Sylvia Tag: puppes Tag: 72793
Resequencing Paragraph Outline Numbering
Hello Everyone,
I'm trying to automate a task. I want the user to select the original
text (example below), execute the macro and convert it to what looks
like in the reformatted example. The assumptions is that there will
never be more than 30 entries for any level of outline numbering. The
text is all plain text as well and all the paragraphs have no styles
associated with them. I've tried coding finding and replacing using
loops but was getting hung up on keeping the numbering together. Any
easy ideas on how to do this?
Original Text:
1. First Paragraph.
a. Sales Plan.
b. Strategy.
(1) Strategy 1.
(2) Strategy 2.
(3) Strategy 3.
c. Marketing Plan.
2. Second Paragraph.
a. Intent
b. Concept of Execution.
(1) Execution 1.
(2) Execution 2.
(3) Execution 3.
Reformatted Text:
1. First Paragraph.
1.a. Sales Plan.
1.b. Strategy.
1.b.(1) Strategy 1.
1.b.(2) Strategy 2.
1.b.(3) Strategy 3.
1.c. Marketing Plan.
2. Second Paragraph.
2.a. Intent
2.b. Concept of Execution.
2.b.(1) Execution 1.
2.b.(2) Execution 2.
2.b.(3) Execution 3.
Thanks for the help!
Terry Hagen Tag: puppes Tag: 72792
Can Word 2003 preserve the intrinsic formatting of XML documents?
----------------
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=28931d78-3c0d-4e79-9593-6f8e33e4e7d0&dg=microsoft.public.word.vba.general Tag: puppes Tag: 72761
File Open Dialog based on startup directory
Hi,
I'd like for word's File-Open & Save-As dialogs to point to the directory
from which I launched word. For example, I might just launch winword.exe from
the command line, say in directory: c:\abc\xyz in which case I'd like for
File-Open & Save-As to point to this directory. Could you point me to
suitable VBA source-code or inbuilt word menu options by which I can achieve
this ?
Thanks,
Anand. Tag: puppes Tag: 72741
Help, my template file size is out of control!!
Hi all. I've been following everyone's advice and creating a template
and using styles, no direct formatting, etc etc. Now, my template has
grown to over 1 MB and there is not even any content to it yet!!
Is there a way I can go through the document and see what's eating up
all the space?
(my latest addition was a table of contents and table of figures, and I
noticed that jumped it up from 450k to 1.1MB ... however, it seems like
450k is even too large!!) Tag: puppes Tag: 72735
Programmatically creating charts with Word and VB.Net
Hi to all!
I have an issue that has been bugging me for quite some time and I hope that
someone might be able to point me into the right direction here.
The story is â?? I am writing an application that would allow a user to create
a Word output from pre-defined data tables. The output can contain both
charts and tables. While generating the output, Word or MSGraph cannot be
visible to the user. What I have is something like this
[CODE]
private sub AddChart(params)
Dim oShape As Word.InlineShape
Dim oChart As Object
oShape =
_wordDocument.Bookmarks.Item("\endofdoc").Range.InlineShapes.AddOLEObject(ClassType:="MSGraph.Chart.8",
FileName:="", LinkToFile:=False, DisplayAsIcon:=False)
oChart = oShape.OLEFormat.Object
If (chartOptions.UpdateDataSheet(oChart) <> True) Then
CLogger.Log("Chart has no data present. Check to make sure you
are not hidding the entire chart", CLogger.EntryType.Warning)
End If
CLogger.LogIf("Updating Chart Options")
chartOptions.UpdateChart(oChart)
oChart.Application.Update()
oChart.Application.Quit()
AddSection()
End sub
[/CODE]
Here is what happens â?? first time we run this â?? everything is good, second
time, Word document becomes visible as well as the MSGraph window appears.
It happens when we hit the line with oShape = ��.
I am wondering if someone knows the way to hide that Word document and that
MSGraph window.
Thanks in advance. Tag: puppes Tag: 72730
How do I UNHIDE ALL the toolbars in Word?
Whenever I start up Word, I only see the Blue bar at the top of the window
and the blank Word document. There are NO TOOLBARS shown (at the top,
bottom, or on the sides of the window). How do I get the toolbars back? Tag: puppes Tag: 72727
set field sequence mandatory completion in form
I would like to create a form with the the first few fields to be a mandatory
completion before going on to the next. Tag: puppes Tag: 72725
Track changes, deletions and additions
I have a bunch of documents with addition and deletion markups.
I want to make a macro that will go through an entire document, find
everything that is a deletion, put a true strikethrough on it, then deny the
changes, so it stays on page, and keeps the strikethrough.
Then i want the macro to go through and find all additions, font.color them
wdColorRed, and accept the changes, so they're on the document and color of
red.
If anyone can help it's much appreciated. Tag: puppes Tag: 72704
Auto-create chart objects
I have an excel spreadsheet with 600 rows in it. Each row has the name of an
item followed by several columns of numbers.
I need to create 3 different small charts in a Word document for each row in
the spreadsheet. In word, you will see a Item Name, with 3 small, but
different charts on the next line, followed by a blank line.
I know I can create the charts in Excel using a macro and then copy and
paste them into word as pictures. Once that is done, I can tell word to run
a macro to format the pictures. But the quality of the text breaks down
depending upon how much I stretch the charts.
WHAT I WOULD RATHER DO is, either from Excel, tell word to insert Excel
chart objects or from Word, get the data from Excel and create the chart
objects.
Using the first method, I have created a macro in Excel to tell Word to run
a macro to put in a line of text with the item name in it, followed by a
paragraph break, followed by inserting an Excel object. But where do I put
the macro that tells the Excel object how to format itself? I do not want to
store the macro in each Excel object as that would bloat the document. I
have tried to place the Macro back in the original Excel sheet, but when I
tell it to run, it seems to want to run within the original Excel sheet, not
within the Excel object in Word.
What am I doing wrong? Or am I missing something even simpler that would
solve my problem? Tag: puppes Tag: 72703
View.ShowBookmarks problem
Hello,
if I change the value of View.ShowBookmarks for a specific document =
window, it seems that Word will remember the setting and apply it to the =
all the documents it opens subsequently.
Is there a way to avoid this?
Best wishes,
Alex.
--=20
Address email to user "response" at domain "alexoren" with suffix "com" Tag: puppes Tag: 72702
Word 2000 Merge with VBA
I have a name badge document that I routinely merge with an Access data base
on a server. I create name badges for several offices. Each office is
generated with a make table and 2 append queries, with a query for the final
data.
The final data query for each office is used to create the name badges for
each office.
I recorded the merge process for one query, then copied for each office.
The code is:
Sub Merge_EventsDataBase_HOU()
'
' MailMerge Macro
' Macro recorded 8/17/2005 by cm9125
'
ActiveDocument.MailMerge.OpenDataSource Name:= _
"I:\Access\Registration_Lists_Pinnell\RegistrationLists_Original.mdb", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"QUERY Qry-N_B-Office-HOU-4-FinalData", SQLStatement:= _
"SELECT * FROM [Qry-N_B-Office-HOU-4-FinalData]", SQLStatement1:=""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
End Sub
Copied this code and changed the query name for each of the other offices.
This code ran fine, but when I tried the other offices got "Run-time error
'5922': Word was unable to open the data source."
Can someone help me with this? Also, on my computer it goes to the "I:"
drive. On someone else's computer it may not be "I:". Is there a way to let
the other user enter their drive number? Tag: puppes Tag: 72697
genreate ms-word doc from excel
Hi all,
I have worked on an excel project recently with a lot of help form
this board. The goal was to assort couple of tables from one sheet to
another to make things easier for comparison. Now I have a new task. I
need to generate couple of ms-word documents from this excel sheet. The
plan right now is to have a menuitem like "Generate docs" in excelsheet
and by clicking on that we can generate about 40 word documents or so.
We have a word template file. For each word document we need to have
the folowing things
1. Module name as the heading
2. Description of the module
3. Table of data
All these information are in the excel sheet. They are stored in excel
sheet using named ranges. Now, I need to gather these data and generate
the word docs. What would be the best approach to solve this problem.
Ideally we would like to do this with out even opening the word
application. I am requesting your valued suggestions on this problem.
Thanks in advance,
shishi Tag: puppes Tag: 72694
Passing values from one .dot file to another .dot file
Iam New member for this group!!!!
My project is to pass values from .dot file to another .dot file (lets
say two .dot files test1.dot and test2.dot)
test1.dot: When user runs the macro go(), the wizard / form will be
open to enter the employee number, once he enters, it prints the
Employee number in a document (Doc1) and saved it to the disk, after
this it will open test2.dot
test2.dot: This should calculate the salary based on the employee
number received from the test1.dot, and attach the salary component to
the earlier created file (Doc1) by test1.dot
Iam not sure how to pass the values from one .dot file to another .dot
file
test1.dot code
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Private Sub CmdFinish1_Click()
ActiveDocument.Bookmarks("Firs=AD=ADtName").Range.Text =3D
Me.txtFirstName.Text
ActiveDocument.Bookmarks("EmpN=AD=ADumb").Range.Text =3D Me.TextBox1
test1.Enabled =3D False
ActiveDocument.SaveAs FileName:=3D"C:\doc1.dot"
ActiveDocument.SaveAs FileName:=3D"C:\doc2.dot"
Call test2
Unload Me
Application.Quit
End Sub
Public Function test2()
Dim wrdAppl As Word.Application
Set wrdAppl =3D New Word.Application
wrdAppl.Documents.Open ("C:\test2.dot")
Set wrdAppl =3D Nothing
End Function
test2.dot code
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Private Sub Document_Open()
ActiveDocument.Bookmarks("bksa=AD=ADlary").Range.Text =3D salary
test2.Show
End Sub
Public Function salary() As String
Dim sal As String
If
(ActiveDocument.CustomDocument=AD=ADProperties.Item("Employee").V=ADa=ADlue
=3D "1") Then
salary =3D "100K"
ElseIf
(ActiveDocument.CustomDocument=AD=ADProperties.Item("Employee").V=ADa=ADlue
=3D "
") Then
salary =3D "Salary not generated"
End If
End Function
Private Sub CmdFinish2_Click()
ActiveDocument.Bookmarks("Last=AD=ADName").Range.Text =3D
Me.txtLastName.Text
Dim Doc1 As Word.Document
Set Doc1 =3D GetObject("C:\doc1.dot", "Word.Document")
Doc1.Range =3D Doc1.Range + ActiveDocument.Range
Doc1.SaveAs FileName:=3D"C:\doc3.dot"
Doc1.Close 'close doc3
Set Doc1 =3D Nothing
Unload Me
ActiveDocument.Close 'close test2.dot
End Sub
in test2.dot
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
I have written code to read the values from customdocumentproperties if
we want to see manually ..open any document go to File menu ->
Properties -> Custom Tab.
What i need is to get the employee number from test1.dot to the custom
properties of the test2.dot so that i can perform necessary salary
calculations
If any of know how to pass the values from .dot file to another .dot
file will be a great help
You can directly mail to me if you need the test1.dot and test2.dot
files for any clarification
I will also update the groups as and when required=20
Thanks=20
Srini Tag: puppes Tag: 72693
OT: Agent Forte and Private Groups
Hi everybody,
since the last harddrive crash I'm trying without success
to get back to the private groups. I'm using agent forté.
Maybe someone can help me via EMail,
as I don't want to molest the group with this.
Might become a long story, as I am completely lost
and I don't have the faintest idea where to start.
Helmut Weber Tag: puppes Tag: 72689
Problem with Word Code in 2003
I am performing a mail merge in Word through an Access database. As part of
the process, I check to see if a Word document is already a mail merge
document, and then, if it is, if it has the correct data source. Thus, from
within Access, I use:
If objWord.ActiveDocument.MailMerge.State=wdMainAndDataSource Then
...
This has worked fine with Access/Word 2000, or if the program is used with
Access/Word 2002. However, with Access/Word 2003, the MailMerge.State value
returns wdNormalDocument (0) instead of wdMainAndDataSource (2). I
double-checked the document, and it clearly is a mail merge main document
with a data source. When when read through Access, I get the return value of
a normal document.
Any ideas as to what's going on?
Thanks,
Neil Tag: puppes Tag: 72688
date code question
I am trying to modify the date code field to automatically populate a date in
my word document X number of days from the present date. Would I be able to
modify the following to accomplish this task and if so, how would you go
about doing it?
{ DATE \@ "dddd MM/dd/yy"}
So, when this document is edited today (08/18/05), the code will produce:
Thursday 08/18/05
I want to modify the code so it is always smart enough to add X days to the
date automatically. So, if I wanted it to display a date 7 days into the
future (X=7), output would automatically be adjusted to display:
Thursday 08/25/05
How can the date code listed above be modified to accomplish this? Thanks. Tag: puppes Tag: 72687
Controlling text wrapping around an image.
Hello
We generate word documents from content in a database (AuthorIT
application). I want to have an image on the front page of my document
_behind_ the text. When generated, the text is wrapped around the image. I
want to use a macro to set the image to display beneath the text.
I have come up with this macro:
Sub MoveImage()
Dim iShape, Shape
On Error Resume Next
For Each iShape In ActiveDocument.Sections.First.Range.InlineShapes
iShape.ConvertToShape
Next
For Each Shape In ActiveDocument.Sections.First.Range.ShapeRange
Shape.WrapFormat.Type = wdWrapThrough
Next
End Sub
This doesn't work when run as soon as the doc is generated, but curiously
does work if i manually select the image then run it.
Can anyone help me to develop a macro that will set the desired wrapping
without any manual action?
Thanks
Dave. Tag: puppes Tag: 72671
HELP!!- Object or class does not support set of events
Hi. I'm trying to run a mailmerge from VB6(sp6) which produces a set of
labels. It works fine from my development machine but when I install the app
anywhere else I get the error above.
I'm not even sure where to start in trying to solve this error. Any help at
all would be greatly appreciated.
I'm developing on XP and the project references Microsoft Word 11.0 Onject
library...if that helps.
Thanks Tag: puppes Tag: 72668
Some method to have allways 'macro' docs ?
Hello again :
I know all the conditions regarding macro security, but I really want a
corporate system to avoid that somebody can't open a doc without use it's
autoopen macro.
I know about server solutions, but my ask is the next : If user have top
level of security set, is it possible to force to user to execute corporate
macros ?
Thanks and excuse my bad english
Antonio Pérez Tag: puppes Tag: 72665
Find method rebound sometimes
Hello :
I have a document with paragraphs and tables, in some cases I have nothing
( only a carriage return symbol ), but ( because many people worked in the
docs ) it has a style I want to change.
I have a macro to find all these cases but my 'do... loop macro' rebound
eternally when find those cases. I fix the problem making :
Selection.MoveRight(Unit:=wdCharacter, Count:=1)
Selection.MoveDown(Unit:=wdLine, Count:=1)
but it is not the solution ( in addition it fails )
Some idea ???
Antonio Pérez Tag: puppes Tag: 72664
Print Directly To PDF
What line of code would I use in word to print a document directly to a PDF
without getting in information form the user. The variables that I would want
to set in code would be:
For the PDF to be saved in the same location as the original document.
I want to set the name of the PDF in code
The name of my PDF printer is: "Adobe PDF"
I just want to put a button on a word document that prints the current to a
PDF storing it in the same location as the original document and with a file
name that I set in code.
Thankyou in advance for your help. Tag: puppes Tag: 72660
Word should have a dumb mode
Word should have a mode that turns off all the auto-formatting to that you
can write a document in free format. I'm thinking of a simple toggle button
rather than having to go into a menu and uncheck a bunch of boxes. Recent
versions of Word have become too damn helpful.....
----------------
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=f76929cd-0b91-4043-bcb1-22c087f0e219&dg=microsoft.public.word.vba.general Tag: puppes Tag: 72658
document object prompt unexpected save as dialog
In my VB6 DLL, I create a word document object, and some mailmerge and save
to a file. It works well before but now (No any change to this DLL) it prompt
an unexpected save as dialog, and after I save the document, dll raise error
"you cann't insert the selection into table". In vb code I called
document.saveas funcion.
Can anyone help? Tag: puppes Tag: 72650
Display Print Dialog
Thankyou in advance.
I have the bellow code capturing the print event. But what I would like to
do is still display the Print Dialog so the user can change which Printer
they wish to print to instead of just the default.
Sub FilePrint()
ActiveDocument.txtBox = "Job File Copy"
ActiveDocument.PrintOut
ActiveDocument.txtBox = "Client Copy"
ActiveDocument.PrintOut
ActiveDocument.Save
End Sub
The requirement for the document is that it prints out in duplicate and the
heading needs to be different on each print out. The above code achieves the
printing in duplicate and changing the headings but only to the default
printer. I would like to display the Print Dialog so that they can change the
printer.
Thankyou again. Tag: puppes Tag: 72648
.Next feature
In the following code why does the line MsgBox aWord.Next return just the
first letter of the next word rather than the complete word? Thanks
Sub Testing()
Dim aWord
For Each aWord In ActiveDocument.Range.Words
MsgBox aWord
MsgBox aWord.Next
Next aWord
End Sub
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: puppes Tag: 72647
Programatically adding new autotext entries to a global template
I'm in the process of (hopefully) improving the overall use of Word
XP in our small office. Being a self-taught newbie to VBA, I've found
this newsgroup to be of real value as a source of info and tips.
As part of the process, I've created a global template ( called
RI_Global.dot) which will hold, amongst other things, all our
generic autotext entries, ie - ones we want to be available all the
time in any document.
What I'm seeking guidance about concerns the way a new user-created
autotext entry is "saved" to a template. My understanding is that the
default choice is the normal.dot template, whereas I want the entry to
be saved into RI_Global.dot.
Is it possible to "force" a newly created AutoText entry to be saved
into RI_Global.dot, rather than relying on the users to remember to
choose this template when they access the Insert/AutoText/AutoText
command? Also, can I intercept the "Alt+F3" shortcut to again force the
entry to be saved to my global template?
I've found the appropriate(?) dialog which might be interceptable [ie:
Dialogs(wdDialogEditAutoText)], but I can't see how any of the options
can be manipulated through VBA. Using the macro recorder and selecting
the global template from the "Look in:" drop-down box doesn't shed any
light on the steps involved when I look at the resulting code.
Thanks in anticipation.
Regards,
Gavin Tag: puppes Tag: 72645
Amending the File Open dialog
Since upgrading to Word2003 I notice that the "Look in" box in File/Open
dialog always seems to point to the last directory I used. Whilst this is
sometimes convenient, most of the time I want to open files in the specific
directory, "DirName", which I have created to contain my most used files,
with its own
tree substructure.
I therefore wish to ensure that "Look in" always defaults to that given
directory.
Could (or should) this be achieved by modifying the following module already
installed which ensures that the "Files of type" box always shows "All
Files":-
Sub FileOpen()
With Dialogs(wdDialogFileOpen)
.Name = "*.*"
.Show
End With
End Sub
Or should a separate new module be used.
Being not too familiar with the Visual Basic codes, can someone kindly
advise how to do this.
Thanks Jack Sadie Tag: puppes Tag: 72643
drag & drop to word
Hi, how to enable drop function(have a drag icon displaying, like drag
something from outlook to Word) when I drag files in my application(VB
application) into MS word document. Please help. Thanks. Tag: puppes Tag: 72638
Creating documents with a serial number
I'm trying to figure out how to serialize documents when printing. For
example, if I want to print 30 copies, I'd like each copy to have a different
serial number for each one from 01-30. This would ideally be placed in a
document footer, and would reset (or not reset) each time the document is
openedAny help would be greatly appreciated. Tag: puppes Tag: 72637
How to Add Hyperlink to Protected Word Form
Not sure if this is possible but I have a protected Word form where I need
the following to happen:
I have a checkbox where if it is unchecked then TextBox1 should be "N/A".
However
if the checkbox is clicked, I need Textbox1 to populate with Null, and
Textbox2 to populate with a hyperlink.
Anyone have any ideas how to do this?
BTW I'm a beginner when it comes to programming so layman's terms would be
great! Tag: puppes Tag: 72636