I have created a macro for X4. My question is, I want to have a symbol per letter. So one symbol will be A, another symbol will be B, etc. So someone can type in a word, click a button and it shows all the symbols they chose. I am guessing I save each symbol separate with a filename of like symbol_a, but how do you get it to identify what you typed to the letter and to display each letter/symbol out in a line? Right now if I click the button, it imports a letter(symbol) showing it, but there aren't any tutorials showing how to use a textbox. I am assuming I would grab the text with something like TextBox1.Text = "Data imported successfully" Thanks
I think I understand what you are trying to do. Here is a little help.
The following will prompt with a dialog box that you can type into. Enter your word or text. It then will loop through each character that you typed and import a symbol for each one.
You will want to change the following line to the path your symbols are stored in:
Const strFILEPATH = "C:\Temp\Symbols\" 'Folder your symbols are in
You will also want to change the following line to how you have named your files:
Const strFILENAME = "Symbol_" 'How you named your symbols
If you kept everything like above and you typed "a" the code would then import the file: C:\Temp\Symbols\Symbol_a.cdr
Sub SymbolMe() Dim strValue As String, strChar As String Dim i As Integer Dim s As Shape, sPrevious As Shape Const strFILEPATH = "C:\Temp\Symbols\" 'Folder your symbols are in Const strFILENAME = "Symbol_" 'How you named your symbols strValue = InputBox("Please type your characters:", "SymbolMe") 'Get the characters from the user 'Loop through each character that was typed For i = 1 To Len(strValue) strChar = Mid(strValue, i, 1) ActiveLayer.Import strFILEPATH & strFILENAME & strChar & ".cdr" 'Import your symbol Set s = ActiveShape If Not sPrevious Is Nothing Then s.SetPosition sPrevious.PositionX + sPrevious.SizeWidth, sPrevious.PositionY 'If a previous symbol was import alight them End If Set sPrevious = s Next i End Sub
Hope that helps,
-Shelby