Question : Help with setting up some Word tables

Hi,

I'm trying to build a word document via code (vb.net) .  At the moment its going okay, however I am getting stuck on some areas.

I've added a table.  I now wish to remove the spacing from the table (or cells).  I've tried to create the macro which produces this code to offer some clues:

Selection.Style = ActiveDocument.Styles("No Spacing")

However I can't get this to work in the asp.net page?

Here is the code that I have used to create the table:

WTableTop = WrdDoc.Tables.Add(Wrd.Selection.Range, 10, 4)

Any help appreciated.

Can't figure out how to select certain cells / tables and then act upon that selection?


Answer : Help with setting up some Word tables

Hey Sorry about that issue, I am super tired very long day and very little sleep there were several stupid typos.

I was falling asleep trying to fix it, but I did actually test the script this time which I was too bust to do today while at work, so I know it functions correctly under windows 7 any way.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
::------------------------------------------------------------------------------------------------::
:: Script: MyDocsDelete.Bat		                                            				 	  ::
:: Version: 1.4                                                                                   ::
:: Copyright: Ben Personick                                                                       ::
:: Date: 2010-07-08                                                                               ::
::                                                                                                ::
::                                                                                                ::
:: Desc: Deletes all files and folders underneath the mydocuments folders of multiple users.	  ::
::	  DOES NOT Delete the My Pictures or My Shapes Folder, ONLY the Files within them			  ::
::																								  ::
::------------------------------------------------------------------------------------------------::
:Begin
@Echo Off

::------------------------------------------------------------------------------------------------::
:: This section sets up default variable settings and sets the logging directory and file name.   ::
::------------------------------------------------------------------------------------------------::
:Start-Prep
	CALL :Start-Set-Date
	SET Preamble=MyDocsDelete --
	::--------------------------------------------------------------------------------------------::
	:: Sets Relative Paths used to search later.												  ::
	::--------------------------------------------------------------------------------------------::
	SET SDir=C:\Empty
	SET Class=\\PYLON\Some Folder\Class
	
	::--------------------------------------------------------------------------------------------::
	:: This Section Sets up logging variables.													  ::
	::--------------------------------------------------------------------------------------------::
	SET IDir=C:\MyDocsDelete\Logs
	SET ILog=ILog_%TDate%_%TTime%.Log
	SET IDL=%IDir%\%ILog%
	:Start-IDir
		ECHO %Preamble% Checking For %IDir%
		IF EXIST %IDir% CALL :Start-Echo "%Preamble% IDir %IDir% -- Found!"
		IF EXIST %IDir% GOTO End-IDir
		ECHO %Preamble% Creating %IDir%
		mkdir %IDir%
	:End-IDir

	::--------------------------------------------------------------------------------------------::
	:: This Section Sets Default Values for match variables, don't change except for testing.	  ::
	::--------------------------------------------------------------------------------------------::
	REM None Needed.

:End-Prep



:Start-Main
	Call :Start-Echo "Begining Main Section ON %TDate% AT %TTime%"
	
	:Start-MKSDir1
		ECHO %Preamble% Checking For "%SDir%\My Shapes"
		IF EXIST "%SDir%\My Shapes" CALL :Start-Echo "SDir %SDir%\My Shapes -- Found!"
		IF EXIST "%SDir%\My Shapes" GOTO End-MKSDir1
		ECHO %Preamble% Creating "%SDir%\My Shapes"
		mkdir "%SDir%\My Shapes"
	:End-MKSDir1

	:Start-MKSDir2
		ECHO %Preamble% Checking For "%SDir%\My Pictures"
		IF EXIST "%SDir%\My Pictures" CALL :Start-Echo "SDir %SDir%\My Pictures -- Found!"
		IF EXIST "%SDir%\My Pictures" GOTO End-MKSDir2
		ECHO %Preamble% Creating "%SDir%\My Pictures"
		mkdir "%SDir%\My Pictures"
	:End-MKSDir2
	
	:Start-RoBoCopy-Process
	REM Loop though all user subfolders in base folder
	REM for /D %D in ("C:\Some Folder\Class\*" ) DO echo %D
	For /D %%D IN ("%Class%\*" ) DO Call :Start-RoboCopy-Loop "%%D"
	REM For /D %%D IN ('%Class%') DO Call :Start-RoboCopy-Loop "%%D"
	GOTO End-RoboCopy-Loop
		:Start-RoboCopy-Loop
			SET TDir=%~1
			REM  Echo  "The 1 Variable is %1 TDir=%TDir%"
			CALL :Start-Echo "Now Deleting Files and Folders in: %TDir%\My Documents"
			RoboCopy "%SDir%" "%TDir%\My Documents" * /NoCopy /PURGE /S /LOG+:%IDL% /TEE /NP
			GOTO :EOF
		:End-RoboCopy-Loop
	CALL :Start-Set-Date
	CALL :Start-Echo "RoboCopy Processes Completed! ON %TDate% AT %TTime%"
	:End-RoBoCopy-Process
	
:End-Main
GOTO :EOF


GOTO End-Subs
GOTO :EOF
:Start-Subs
	GOTO :End-Set-Date
	:Start-Set-Date
		SET TDate=%date:~10,4%-%date:~4,2%-%date:~7,2%
		SET TTime=%Time:~0,2%.%Time:~3,2%.%Time:~6,2%
		GOTO :EOF
	:End-Set-Date
	GOTO End-Echo
	:Start-Echo
		Set TEcho=%~1
		ECHO %Preamble% %TEcho% --
		ECHO %Preamble% %TEcho% -- >> %IDL%
		GOTO :EOF
	:End-Echo

:End-Subs

:End
Random Solutions  
 
programming4us programming4us