Paste as HTML into a cell
Hi,
I'm doing a macro that connects to a web site, reads one page, and save its
contents inside a cell of table.
Basically I'm doing the following;
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
objHTTP.Open "GET", strURL, False
objHTTP.Send
Selection.Text = objHTTP.ResponseText
The problem is that Word doesn't recognize the text as html, so, I can see
the source of the page. I want to paste it as a HTML.
Another problem is that I'm using a table. So, I tryied to use
Selection.Paste, but it doesn't work.
TIA, Tag: using Word Tag: 86412
Insert WMF file in the word document
Hi all,
I'am trying to insert WMF file in the word 2000 through code.
If there are more then 2 pages in the document it gives me error and
the autoshape property gets
lost of the WMF file.This WMF file can be inserted through insert
picture-> from file option.
when you do this manually the WMF gets inserted as autosahpe or else it
get inserted as picture.
The error which i get is as follows:-
Microsoft Visual Basic
---------------------------
Run-time error '-2147467259 (80004005)':
Can't move focus to the control because it is invisible, not enabled,
or of a type that does not accept the focus.
---------------------------
OK Help
Please let me know solution for this.
Thanks in advance.
-Sajin Tag: using Word Tag: 86402
Attach a web page
Hi!
Is it possible to get the source code from an active web page using
VBA-Word? I have an open web page in IE, and need to catch some info
from the source code and put it into my active Word-document.
-Ole Tag: using Word Tag: 86400
Wildcards and templates
Hi all,
If a specific template is active a toolbar must appear. The template has one
little thing: It has a versionnumber. So I am looking for a code something
like:
If Activedocument.attachedtemplated="Proposal" & * then
CommandBars ("test").visible=true
end if
The first line doesn't work. Anyone any idea? Tag: using Word Tag: 86390
I only want to delete Plc 0% not L 5:0:0
Hello from Steved Thankyou in Advance.
When I run the below macro it deletes the whole paragraph is it possible
please to modify the below macro to delete Plc 0% and leave L 5:0:0
Plc 0% L 5:0:0
Sub Win()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="Plc [0-9]%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
End With
End Sub Tag: using Word Tag: 86386
Reading picture types in vba
i have written some code to convert picture files to metafile:
Sub CompressPictures()
Dim x%
With ActiveDocument.InlineShapes
For x% = 1 To .Count
.Item(x%).Select
Selection.Cut
Selection.PasteSpecial , , wdInLine, , wdPasteMetafilePicture
Next
End With
End Sub
i add pictures (screenshots) to the document regularly and would prefer only
to covert the new pics (bitmaps i think) - but i dont know how to read the
picture type before writing it - any ideas?
InlineShapes.Type ????? Tag: using Word Tag: 86381
VBA control vscroll and hscroll in a frame
I need to be able to position the vertical and horizontal scroll bars in a
Fame object from VBA. I have searched the internet for an API or code o do
this without success. The only frame routine (scroll) doesn't seem to do
this. Any help would be appreciated.
Gary Tag: using Word Tag: 86380
Date Format Question
Is there a way to include a non-breaking space between the month and day in
the following date format code so that the month and day do not separate when
they appear at the end of a line?
ScheduleDate1 = Format(ScheduleDate, "mmmm dd, yyyy")
Thanks...
--
singeredel (Julie) Tag: using Word Tag: 86375
HTMLProject and Office 2007
Since I installed Office 2007 beta (latest one on May 26th), I am unable to
access the HTMLProject property of a Word Document object using VB6. I get
"Application Defined Error" if I view it using Watch. I get method of ~
failed when running the program. Basically the code is:
Set WordApp = CreateObject("Word.Application")
Set worddoc = WordApp.Documents.Add
Set prjItem = worddoc.HTMLProject.HTMLProjectItems.Item(1)
This code works fine in Word 2000, XP and 2003.
Any ideas what may be wrong?
Thanks
Kevin O'Brien Tag: using Word Tag: 86374
Error 462 The remote server machine does not exist or is unavailable
From Access, I need to open Word, merge a document, and leave the merged
doc open. All works fine (pseudo code) except that I am not able to
release the objWord variable at the end of the routine, thus the error
the next time I try to run the merge. Calling Quit closes Word, I need
it kept open.
Public Function Merge()
Dim objWord As Object ' or Word.Application
Dim docResult As Word.Document
Dim docMerge As Word.Document
Dim strPath As String
Dim strDocName As String
Dim strDotName As String
Dim strDBName As String
Dim strPathDocName As String
Dim strPathDotName As String
Dim strPathDBName As String
Dim strPhaseSet As String
Dim strMergeTable As String
Set objWord = New Word.Application
objWord.Documents.Open strPathDotName, False
Set docMerge = ActiveDocument
With docMerge.MailMerge
.OpenDataSource _
Name:=strPathDBName, _
LinkToSource:=True, _
Connection:="TABLE " & strMergeTable, _
SQLStatement:="SELECT * FROM [" & strMergeTable & "]"
.Destination = wdSendToNewDocument
.Execute
End With
' Close the template file
docMerge.Close
' Show word
objWord.Visible = True
Set docResult = ActiveDocument
' Save the merged document to the project file name.
Set docMerge = Nothing
Set docResult = Nothing
Set objWord = Nothing
End Function Tag: using Word Tag: 86373
Can I add "Plc [0-9]{1,}%"
Hello From Steved Thankyou in Advance.
Can I add "Plc [0-9]{1,}%" to the below macro or do I have to have 2 macro's
please.
Sub Win()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="Win [0-9]{1,}%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
End With
End Sub Tag: using Word Tag: 86365
word forms
I want to be able to make a form using MS Word and have that form with check
box selections. Based upon the boxes the user checks, I want pre-made word
forms to merge into one document / package that can be printed off after the
user finishes the merged document. Can this type of merge be done? I'm not
very good with macros or VB myself but can populate numerous forms utilizing
one form field. Any simple examples would be highly appreciated. Tag: using Word Tag: 86364
Importing PDF as image
PDF is essentially an image file (or something closer to image than text.),
is it not? Is there a way to import a PDF file into Word (and ultimately
automatically using VBA).
I have a PDF >> Word converter which does a sort-of OCR scan, but that's not
what I want. It is perfectly okay if the text is an image, and not real
(editable) text.
Thanks,
Ed Tag: using Word Tag: 86362
word right click menu should be able to be disabled
When highlighting text or right clicking on text the menu that gives you
font, size, bold and other stuff should be able to be disabled as sometimes
it can get annoying when reading through things or when just highlighting
text to read it.
----------------
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=3a299703-114e-44c6-96e7-b5de5523140e&dg=microsoft.public.word.vba.general Tag: using Word Tag: 86358
Macros
When programming macros in WP 5.1, I would use CTRL PgUp RETURN RETURN so
that I could insert text when I ran the macro. How can I program a macro
with the CTRL PgUp RETURN RETURN command in MS WORD? Pausing the macro does
not work. Tag: using Word Tag: 86357
Add-In button fails after document changes
I'm using office 2003 and have a Word Add-in built using the VBA editor the
comes with Office Pro.
The Add-In creates a command bar and adds a button with events. The onclick
event works for the first document. When you click the button on a second
document, the onclick event doesn't fire.
It will continue to work, if you only have one document open, meaning you
need to close one document and then open another for the onclick event to
fire and the code to execute.
Can anyone help as I don't understand why the event isn't firing for the
second documents.
Thanks,
Brian Tag: using Word Tag: 86348
Macros security message on code pasted into editor.
When I migrated to Word 2003, I brought most of my Word 97 macros with me. I
just remembered one I had forgotten, and opened the old application, copied
the code, and pasted all the code for the macro it into the Word 2003 VBA
editor (macros for Normal.dot). When I tried to run the macro, it said that
my security settings wouldn't allow the macro to work.
How do the security settings distinguish between pasted code from somewhere
else and a macro that is recorded in Word and then edited? I don't understand
what I did that caused a security issue. Tag: using Word Tag: 86346
Startup File Not Available
I placed a template on one PC in the directory located at
Tools...Options...File Locations...Startup - and the toolbars and macros are
available. On another PC, with the file placed there, it is not available.
And I switched Security to low. Any reason the template toolbars and code
would not be available?
Derek Tag: using Word Tag: 86344
Word to Excel or Access
I've inherited numerous Word documents that should have been prepared in
Access or Excel originally. They are basically logs with a name and account
number. There is Header at the top of each page which contains information I
don't really need. Included in the Header are the Column headings "Name" and
"Account Number". In the body of the text, the person typed the name then I
believe tabbed over to type the account number.
Is it possible to convert these to Access or Excel? Right now, I can copy
and paste the information but there are several documents. I'll be here all
night..... Tag: using Word Tag: 86338
calling a function in word document dynamically.
I'm setting up a mail merge document which checks the dates in two fields and
if the difference is greater than or equal to 14, it then places a certain
statement into the document. I've tried to use DateDiff() directly but it
doesn't work. I tried creating a Function where the two fields are passed
ByVal to a function. Then within the function the DateDiff("D", sDate,
ThatDate) function is called and returns a yes or no value which would allow
the document to insert the appropriate statement. But how do I call the
function dynamically when the document merge is performed. I hope this is
clear. Can anybody help?. Tag: using Word Tag: 86336
ExtFloodFill on a word picture
Hi guys! I've a question for the NG: is it possible to use ExtFloodFill
API on a MSWord picture (BMP, WMF, ... not important)? How can I handle
a picture object?
Thanks in advance!!
Riccardo Tag: using Word Tag: 86332
Form fields & calculation field formats
I have a table with a form field (for a user to enter a currency amount) and
a calculation field in the row below and I want them formatted the same.
I was hoping to be able to apply the switch from my calculation field to my
form field but can't seem to figure it out!
This is the switch: \# "$#,#.00;-#,#.00;" but there is also a tab between $
and amount so that they line up nicely. Wasn't sure how to show that in here.
My calculation field works fine, but I can't figure out how to use the tab
space with the form field! Tag: using Word Tag: 86328
Marking location of section breaks for later use [Word 2003]
Hi! I am appending a bunch of Word 2003 documents programmatically. I am
inserting section breaks between them. I have a need to later open the
resulting document and insert more documents somewhere in the middle â?? the
user chooses the document after which a new document is inserted.
1)I need to enumerate all documents in the resulting document so I can
display a list of them to the users.
2)I need to know the location or get some sort of reference to the location
of the section breaks so I can insert more docs.
What are my options? What objects/techniques are available to me?
Any ideas/suggestions/code samples are greatly appreciated.
Thank you in advance,
--Michael Tag: using Word Tag: 86322
Macros still work after converting .doc-->.pdf-->.doc???
I'm trying to implement the use of some macros at work and the next problem
facing me is the file control system that we use. All of our documents are
created in Word then stored on the network as a PDF then when you need to
edit them again they are converted to a Word document. So now the question...
Will this conversion cycle (.doc-->.pdf-->.doc) interfere with the macro
that I've created for the document?
Any help would be greatly appreciated! Tag: using Word Tag: 86320
Office 2007 & Ole Automation
Hello,
Just playing around with the beta release and I was wondering if there is a
trick to get ole automation working in the new version?
We have a database application that we've interface into Word to merge data
from our Application into a Word document.
The new 2007 Word runs perfectly under our Application, however when we try
to merge data the "bookmarks" (fields) are not updated.
Is there something new we need to be aware of?
Thanks much for any help. Love the new UI, can't wait to get into it a
little deeper! Tag: using Word Tag: 86319
Resources for working with Word 2003 and xml
I need to have a comprehensive guide to working with xml and word 2003.
Basically the need is to take simple Xml data (mainly from .Net datasets)
from another application and use portions of the data to create/insert into
Word Documents. Thanks. Tag: using Word Tag: 86312
remove hidden codes without changing pagination
When I try to remove the hidden text from the doc, I succeed but it also
takes away all my hard page returns. Is there a way to remove the hidden text
and codes without changing the pagination?
Thanks Tag: using Word Tag: 86311
When I create a PDF via VBA, the pdf doesn't have bookmarks
Bonsoir,
I''m using acrobat 7.0 to create PDF from word 2000.
That's perfect by referencing Acrobat in VBa and using PDFTOFILE method
but my PDFs don't have any links nor bookmarks.
What is the solution to have a "complete" PDF" which have the same
properties as aPDF created by the word menu "convert to PDF".
Thanks for your help.
Eric Tag: using Word Tag: 86310
Pushing or Poking Word form data to an Excel spreadsheet
We have a client who has created a Microsoft Word 2003 form template to
capture risk investment information from managers in our organization.
Managers will fill this document in and return it to this client.
The client would then like to "push or poke" the form data from the word
template into an Excel 2003 spreadsheet.
The excel spreadsheet will have a pre-defined format and specific form
fields or bookmarks from the word document will populate the excel
spreadsheet.
My question - what is the best way to do this?
The word form template will have some 60 fields. Not all of them will be
pushed into the excel spreadsheet but there must be some kind of mapping or
linkage between specfic fields / bookmarks and cell location references in
the excel spreadsheet.
Thanks again for any insight on this one. Tag: using Word Tag: 86309
VBA code to tell you who has a file open
Hi,
Is there some VBA code that can tell me which user is in a file if it is
'read-only' when I open it?
Thanks. Tag: using Word Tag: 86308
I saved a template to a new name and when I run it ...
I have multiple projects with the same name in different times of
developement listed in the IDE screen under which is the new document I want
to work with. How do you "save as" a template and not inherit its parents
projects in the IDE project view? Also the new document is running under the
older verion of the multiple projects listed (all with the same name)...
--
Otium Cum Dignatate Tag: using Word Tag: 86307
Accessing "Style" taking forever in Word 2003
I have a number of macros written and used in Word 2000 which examine a
paragraph's style and then taking action based on that style. When
these are run on Word 2003, the macros go from a run time of 4 seconds
to one of 1 minute 53 seconds. Any ideas? (I'm using XP). Tag: using Word Tag: 86306
Switching Windows Error
Hello,
Currently, I am working on a document that analyzes other documents.
Basically, the user clicks on a button and a dialog box opens up to
browse to a file and the analyzation begins.
It can bring up the dialog box correctly and minimize the current
window of the original document, but when I try to bring the document
to be analyzed into focus, it gives the error:
'Runtime error 5941':
The requested member of the collection does not exist.
Here is the code:
With Dialogs(wdDialogFileOpen)
.Display
DocToAnalyze = WordBasic.FilenameInfo$(.Name, 2)
End With
'On Error GoTo ErrorHandler
'Windows(analyzedoc).WindowState = wdWindowStateMinimize
Windows(DocToAnalyze).Activate
I have commented everything out around the last line and targeted it as
the source of the error, but I am not for sure why. I have tried
putting in other documents open such as "Document4.doc" and "Document4"
but to no avail.
Thank you for any help. Tag: using Word Tag: 86298
How can I make my code run faster?
I have a MS Word 2003 form in which I have 40 checkboxes.
This code below works great but it is r-e-a-l-l-y slow. The reason being
that it is checking each checkbox every time. What I'd like to do is to
speed it up.
Can someone help? I aprpeciate it greatly.....
Function Calculate()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim intWait As Integer
StatusBar = "Please wait..."
For intWait = 1 To 1000
System.Cursor = wdCursorWait
Next intWait
Dim mI As Integer
Dim mColRate As Integer
Dim mCol1Tot As Integer, mCol2Tot As Integer, mCol3Tot As Integer
'look at each item that is a formfield on the active document
For mI = 1 To ActiveDocument.FormFields.Count
'this is checking if this formfield is a checkbox vs a textbox ...
If ActiveDocument.FormFields(mI).Type = wdFieldFormCheckBox Then
'this is looking for something in the name of the checkbox which
keys the loop
'that I want to do something with this particular checkbox
If InStr(1, ActiveDocument.FormFields(mI).Name, "Ineffective") >
0 Or _
InStr(1, ActiveDocument.FormFields(mI).Name, "Capable") > 0
Or _
InStr(1, ActiveDocument.FormFields(mI).Name, "NA") > 0 Or _
InStr(1, ActiveDocument.FormFields(mI).Name, "Superior") > 0
Then
'this counts all boxes that need to be counted in the above
list
mColRate = mColRate + 1
'determines which column needs to be counted and keep a total
If InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective1") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable1") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior1") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective2") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable2") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior2") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective3") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable3") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior3") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective4") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable4") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior4") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective5") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable5") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior5") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective6") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable6") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior6") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective7") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable7") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior7") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective8") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable8") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior8") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective9") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable9") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior9") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Ineffective10") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol1Tot = mCol1Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Capable10") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol2Tot = mCol2Tot + 1
ElseIf InStr(1, ActiveDocument.FormFields(mI).Name,
"Superior10") > 0 And _
ActiveDocument.FormFields(mI).CheckBox.Value = True Then
mCol3Tot = mCol3Tot + 1
End If
End If
End If
Next
ActiveDocument.FormFields("Col1Tot").Result = mCol1Tot
ActiveDocument.FormFields("Col2Tot").Result = mCol2Tot * 2
ActiveDocument.FormFields("Col3Tot").Result = mCol3Tot * 3
ActiveDocument.FormFields("Total").Result = ((mCol3Tot * 3) + (mCol2Tot
* 2) + mCol1Tot) / 40
MsgBox ("Calculation Completed")
StatusBar = "Task completed"
System.Cursor = wdCursorNormal
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Function Tag: using Word Tag: 86297
Strange Print error with VBA created doc
Hi This may or not be vba related.
Has anyone ever encountered a prioblem like this before, Or know a
solution
A table cell in a word doc contains multiple address lines, created
using the code below in a template.
The address loooks just fine in Word and even in print preview, but on
the actual paper on the first line appears. Also intermittent , works
ok on some printers.
Users have found a workaround, cut the address then paste it back
before printing.
Any thoughts ?
Thanks
hals_left
Set objRS = objConn.Execute(strSQL)
If Not objRS.EOF Then
strAddress= objRS("BusinessName")
strAdd1 = objRS("Add1")
strAdd2 = objRS("Add2")
strAdd3 = objRS("Add3")
strTown = objRS("TownCity")
strCountyLine = objRS("County") & vbTab & objRS("PostCode")
If strAdd1 <> "" Then strAddress = strAddress & vbCrLf &
strAdd1
If strAdd2 <> "" Then strAddress = strAddress & vbCrLf &
strAdd2
If strAdd3 <> "" Then strAddress = strAddress & vbCrLf &
strAdd3
If strTown <> "" Then strAddress = strAddress & vbCrLf &
strTown
strAddress = strAddress & vbCrLf & strCountyLine
ActiveDocument.Tables(2).Rows(1).Cells(1).Select
Selection.Text = strAddress Tag: using Word Tag: 86295
How do I download a version of Microsoft Word?
My computer crashed and I seemed to have lost Microsoft word and I want to
know how I can download a version of it or do I have to buy the software from
the store. Tag: using Word Tag: 86285
Save Word document to a database
For memo type fields in my database I want to be able to use word as the
editor. I have a Visual studio 2005 forms based application that interacts
with the database listed invoices etc.. I would like to be able to invoke
word as the editor for description type fields similar to how outlook uses
word for it's message editor. Does anyone have any examples, sample code, or
concepts regarding how to go about doing this?
I am thinking of an approach that would use VSTO. I would have an edit
button on the application that would say invoke word to edit. The
application would retrieve the memo data from the database ( I am thinking
that perhaps I should store the description in HTML format), invoke word,
load the data into word. Then muck with the menus and capture the save and
save as commands and write code to save the data to my database instead of a
file.
I am having trouble figuring out exactly how to go about loading the data
into word and getting the data to save it back out to the database.
Thanks Tag: using Word Tag: 86284
Gremlin space in string data
With the extensive help of Jay Freedman and Jonathan West, I am
beginning to understand color in Word. I have put together a macro for
extracting the Long and RBG value of a color selected in the
Format>Borders and Shading>Shading dialog. I have one problem. For
some odd reason there is an extra space in the second message box
dispaly:
oColorRBG = Str$(rVal) & ", " & Str$(gVal) & ", " & Str$(bVal)
MsgBox "Color long value: " & oColorLng
MsgBox "Color RBG value: (" & oColorRBG & ")"
For "Red" is should dispay: Color RBG value: (255, 0, 0) but it is
coming out
Color RBG value: ( 255, 0, 0)
I can't figure out how to close up the space between the ( and 255.
I realize that this is a minor nit, but would like to figure it out
just the same. Thanks.
Here is the complete code:
Sub QuickAndEasyColorData()
Dim oDoc As Word.Document
Dim oRng As Word.Range
Set oDoc = Documents.Add
Set oRng = oDoc.Range
Dim oColorLng As Long
Dim rVal As Long
Dim gVal As Long
Dim bVal As Long
Dim oColorRBG As String
oRng.InsertAfter "Sample Text"
oRng.MoveEnd wdCharacter, -1
Application.ScreenRefresh
oRng.Select
With Dialogs(wdDialogFormatBordersAndShading)
If .Show = -1 Then
.Execute
Application.ScreenRefresh
oColorLng = oRng.Shading.BackgroundPatternColor
rVal = oColorLng Mod 256
bVal = Int(oColorLng / 65536)
gVal = Int((oColorLng - (bVal * 65536) - rVal) / 256)
oColorRBG = Str$(rVal) & ", " & Str$(gVal) & ", " & Str$(bVal)
MsgBox "Color long value: " & oColorLng
MsgBox "Color RBG value: (" & oColorRBG & ")"
End If
End With
oDoc.Close wdDoNotSaveChanges
End Sub Tag: using Word Tag: 86269
Attachment not appearing.
I've got a W2K template that generates a summary of selected documents.
The user is presented with a list box to choose which items are to be
summarized. I also want to send the selected documents as Outlook
e-mail attachments. I use this to start the e-mail (In the Userform
initialization)
Private Sub UserForm_Initialize()
~
mailtxt = "Assessments done " + Format(Now(), "mm/dd/yyyy")
Set maildas = CreateObject("Outlook.Application")
Set mailmsg = maildas.CreateItem(olmailItem)
With mailmsg
.To = "ASSEMAIL"
.Subject = mailtxt
.body = mailtxt
End With
End Sub
Then this to add the attachment (runs after the doc is summarized)
~
attdoc=ActiveDocument.FullName
mailmsg.Attachments.Add attdoc, olByValue, atpos, "document"
~
The code runs without an error, but the attachment isn't in the e-mail.
Any ideas? I do have a ref to the Outlook reference library. Tag: using Word Tag: 86268
Toolbar Hell
Help, I'm in Toolbar Hell. I've been working on creating a Toolbar
that floats on top or docks per the user's choice. My experimental
Toolbar is named MacroXToolbar and contains the code that I showed in
my previous post, "CoolBar or MacroX Code for Floating Toolbar?" This
code was in my Normal.dot file, which shows up in the IDE as New
Macros. I dutifully saved via cut'n'paste all the code from New
Macros in text files so that it would be easy to revert back to a
previous version of Normal.dot.
Now I'm getting a bunch of grief anyway, and restoring to a previous
New Macros state doesn't help. When I right click on Word's regular
toolbar to see what toolbars are available, MacroXToolbar is listed
numerous times. All these dupe toolbars are there even if I
completely comment out all the code I was using in
Normal.dot/NewMacros.
I clicked on: Tools ===> Customize ===> Toolbars tab, and then
scrolled down and deleted every occurrence of MacroXToolbar. That
worked while I was in the Word document, but as soon as I exited and
restarted Word, they were all back again. I even tried uninstalling
and reinstalling Word. No luck.
I get the k'zillion MacroXToolbars even if all the code I was using is
completely removed from New Macros, so obviously these multiple
nuisance toolbars are saved somewhere where I didn't realize I was
saving them.
If I hit Tools ===> Templates and Add-ins and then uncheck everything
there, I STILL get the phantom MacroXToolbars. And, btw, if I bring
up one of these toolbars and then click on it, nothing happens, which
is to be expected since I've commented out all the code.
Obviously there's something I'm missing. I inadvertently created this
monster, and would be very grateful for any tips offered on how to
slay it. Tag: using Word Tag: 86265
How do I get the XML-features of WORD2003 activated in SE?
Dear all!
MS advertises the new XML-features of WORD2003. Unfortunately, in the
footnotes they clarify, that these features are only available for WORD2003
bought on its own or with the Professional Edition. I wonder, if there is no
way to get these features working with a Standard Edition.
Many thanks for your help in advance!
Reinhold Tag: using Word Tag: 86263
Word is sluggish
Word is sluggish. It is trying to do something in the background that slows
me donw.
For example: I am working in a five-page document with a few embedded
pictures and Word is just sluggish. Evrytime I type something in, it starts
crunching something in the background; I can not see the place holder until
Word has finished whatever it is doing.
While Word is stalling, one can see a little book icon turning its pages on
the left of the status bar at the bottom. When Word is finished whatever it
was doing, a red cross appears over the book.
I would like to stop this process, but I do not know how. I tried right
click on the book icon, and it opened the spell check options. But unchecking
the spell/grammar checks did not resolve the issue.
I opened the Windows Task Manager and I see WINWORD.EXE taking up ~50% of
the CPU activity (the other ~50% are taken by the System idle process).
Can any body help me to regain control of this runaway Word?
Thanks, Victor G. Tag: using Word Tag: 86261
access the numbering on document with ActiveDocument.Sections(1).r
Hello - I am a newbie.. so this might be an easy question! I want a variable
to have a value that represents an all text version of the activedocument.
This is what I am currently using to assign the value to the variable:
ActiveDocument.Sections(1).Range
That works just fine... except it excludes the numbering from the document.
I really need the numbering to be in the text. How would I do that. It
seems to me that this should maybe do it:
JavaScriptArray = ActiveDocument.Lists(1).Range.ListFormat
or this..
JavaScriptArray = ActiveDocument.StoryRanges(wdMainTextStory)
Or some variation of one of the three. They ALL exclude the numbering. I
have feverishly searched for a solution. Please bail me out!
--
Thanks,
Mike Tag: using Word Tag: 86260
Problem with word.activedocument.save at secure urls
Hi,
Pardon and redirect me if this is not the correct group.
We need to save a word doc to a server url. We have written a macro
which uses word.activedocument.save to save it. I know this needs front
page extensions to be installed on the iis and we have ensured its
presence. We are able to save to server when url is simple http -
however it fails with error:#5096 when the url is https.
Does word.activedocument.save have any limitation? Is there any
solution/workaround for this?
Thanks,
Piyush Tag: using Word Tag: 86259
Delete only picture in the header
Hi
I want to use vba to delete only picture in the header.
Lines an other shapes shoud not be deleted.
Maybe somebody can send me the right code for this work.
Thank you
Mitterbuchner Stefan Tag: using Word Tag: 86253
how to allow tracking changes&comments in protected mode
Hi made Template, where user cannot change 1st page and header and footer.
I protected this Doc with Filling in Forms protection.
But I totally forgot about "track changes" and "comments" is there a
posibility to allow user to track changes and insert comments in protected
mode.
Thanks for Help. Tag: using Word Tag: 86249
Prevent loading Toolbar Macro at Startup
Would someone please tell me how to turn off a macro that loads a toolbar
item at startup in Word 2003? I can hide the (Test Director) toolbar at
startup however @ startup it gives a Security Warning about TestDirector.dot
containing Macros. I'd like to set startup to not load TestDirector. I'd
like to load manually if necessary after start up.
Thx,
Ted Tag: using Word Tag: 86246
Macro Names
Is there a way of listing all the macro names in a document?
I have code which loops through opening every document in a given directory,
but how do I list the macros? Tag: using Word Tag: 86245
I want to use Word to design web pages yet I do not want Word as the default
web editor is this possible?
"Red4Con1" <Red4Con1@discussions.microsoft.com> wrote in message
news:F16D8AAD-79FF-47A7-951D-E9EDA259DEAD@microsoft.com...
>I want to use Word to design web pages yet I do not want Word as the
>default
> web editor is this possible?