LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Create Word Docs From Excel Cell Data

Thanks Ossie, I've made all of the adjustments, but haven't done the dialog
box yet. I've saved the code for when I get there. I'm learning VB on VS
2008, so this is slightly different, but good practice.

I sincerely appreciate your help!

"OssieMac" wrote:

I've got a few minutes before I go out today so just a couple of comments.

You haven't changed the object variable from objWord to WordObject in the
clean up. I understand that memory problems can result if these object
variables are not set to nothing when no longer required. As the very first
line in the declarations section of the modules enter Option Explicit and
then when you are finished editing code click Debug - Compile VBA Project
and it picks up any code errors inclucing undeclared variables.

You can force Excel to automatically insert Option Explicit at the top of
modules in NEW projects /modules if you select Tools - Options and on the
Editor tab check Require Variable Declaration.

You have included the template name with the path string
SigCardPathString = "C:\Documents and Settings\nbk337h\Desktop\Excel Process
Docs\FL W9 Sig.dot"

I would do it this way by concatenating the path and the variable
SigCardTemplateString :-

SigCardTemplateString = "FL W9 Sig.dot"

SigCardPathString = "C:\Documents and Settings\nbk337h\" & _
"Desktop\Excel Process Docs\" & SigCardTemplateString

I pointed out the above for two reasons. One for concatenating the path with
the filename variable.
The other shows the method of inserting a line break in an otherwise single
line of code when the break is required in the middle of a string enclosed in
double quotes.
Close off the double quotes and use an ampersand and then the space and
underscore for the line break and then open the double quotes on the next
line for the remainder of the string.

You may have this done by the time you get this but the following is a code
sample for a message to user re the selections:-

Dim Response

Response = MsgBox("Account Number = " & AcctNumberString & vbCrLf & _
"Account Type = " & AcctTypeString & vbCrLf & _
"Account State = " & AcctStateString & vbCrLf & _
vbCrLf & "Click OK to confirm or Cancel to exit", _
vbOKCancel, "Selections for word document ")

If Response = vbCancel Then
MsgBox "Processing will terminate"
Exit Sub
End If

--
Regards,

OssieMac


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel as a data source for Outlook to email Word docs Monomeeth Excel Programming 3 September 25th 08 10:20 AM
Creating Word Docs from Excel Data [email protected] Excel Discussion (Misc queries) 1 October 8th 06 02:55 AM
Import cells from excel into word and create multiple word docs scdaddy7269 Excel Programming 2 March 20th 06 07:03 PM
Embedding Word Docs into Excel Worksheets and Then Printing The Word Docs mr_melvis Excel Worksheet Functions 1 April 8th 05 03:00 AM
converting excel docs to word docs rolercster New Users to Excel 2 January 4th 05 07:11 PM


All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"